Command to say player coords in chat?

[BACK]
Command to say player coords in chat?
Posted On: January 28, 2023

Trying to get a command that tells a player's coords in chat. I have a working command: /data get entity @s Pos, but I assume I would need to combine this with /tellraw?


Question from user Aceplante at gaming.stackexchange.com.


Answer:

You can do that using just tellraw:.


/execute as @p run tellraw @a [{"selector":"@s"},{"text":"'s coordinates are X:"},{"nbt":"Pos[0]","entity":"@s"},{"text":" Y:"},{"nbt":"Pos[1]","entity":"@s"},{"text":" Z:"},{"nbt":"Pos[2]","entity":"@s"}].


That is going to display the coordinates but in the form of a decimal number with a lot of digits. If you want to display whole numbers, what you can do is store the values into scoreboard objectives (storing them converts them to integers) and then display the objectives using /tellraw.


This is how you store the coordinates into objectives:.


/execute store result score @s x run data get entity @s Pos[0].


/execute store result score @s y run data get entity @s Pos[1].


/execute store result score @s z run data get entity @s Pos[2].


And this is how you display the values:.


/execute as @p run tellraw @a [{"selector":"@s"},{"text":"'s coordinates are X:"},{"score":{"name":"@s","objective":"x"}},{"text":" Y:"},{"score":{"name":"@s","objective":"y"}},{"text":" Z:"},{"score":{"name":"@s","objective":"z"}}].


Answer from user MegaCrafter10 at gaming.stackexchange.com.


[BACK]
Command to say player coords in chat?
Posted On: January 28, 2023

Trying to get a command that tells a player's coords in chat. I have a working command: /data get entity @s Pos, but I assume I would need to combine this with /tellraw?


Question from user Aceplante at gaming.stackexchange.com.


Answer:

You can do that using just tellraw:.


/execute as @p run tellraw @a [{"selector":"@s"},{"text":"'s coordinates are X:"},{"nbt":"Pos[0]","entity":"@s"},{"text":" Y:"},{"nbt":"Pos[1]","entity":"@s"},{"text":" Z:"},{"nbt":"Pos[2]","entity":"@s"}].


That is going to display the coordinates but in the form of a decimal number with a lot of digits. If you want to display whole numbers, what you can do is store the values into scoreboard objectives (storing them converts them to integers) and then display the objectives using /tellraw.


This is how you store the coordinates into objectives:.


/execute store result score @s x run data get entity @s Pos[0].


/execute store result score @s y run data get entity @s Pos[1].


/execute store result score @s z run data get entity @s Pos[2].


And this is how you display the values:.


/execute as @p run tellraw @a [{"selector":"@s"},{"text":"'s coordinates are X:"},{"score":{"name":"@s","objective":"x"}},{"text":" Y:"},{"score":{"name":"@s","objective":"y"}},{"text":" Z:"},{"score":{"name":"@s","objective":"z"}}].


Answer from user MegaCrafter10 at gaming.stackexchange.com.


[BACK]

Will I still get weapon discounts in Ratchet & Clank 3 with a Ratchet & Clank 1 new game+ save? Will I still get weapon discounts in Ratchet & Clank 3 with a Ratchet & Clank 1 new game+ save?

Posted On: March 8, 2024
In Ratchet and Clank 3: Up your Arsenal, it's possible to get an "employee discount" at Gadgetron weapons vendors if you have a save file from Ratchet & Clank 1 present on the memory card.The save fil...[More]


Does Bozai show up before defeating Vah Naboris? Does Bozai show up before defeating Vah Naboris?

Posted On: June 13, 2023
Bozai is the NPC in BOTW that gives the player snow and sand boots. I am searching for him around the outskirts of Gerudo Town and I can not find him. I have also looked at the tent he would sit in. T...[More]


Collectors Edition Collectors Edition

Posted On: July 1, 2023
For the Collectors Edition trophy, does it require ALL pages? Or just Revelio pages? Currently stuck on 54/55 in Hogsmeade and can't for the life of me find the missing page, I have all the Rev...[More]


How long did it take you to find the demiguises in Hogwarts? How long did it take you to find the demiguises in Hogwarts?

Posted On: April 16, 2023
I've been looking on and off for 4 days now but still only have 3 out of 9. I don't really want to cheat and search a location map on the internet. How long did it take you to find them? . ...[More]


How can I perform an arbitrary search in the Xbox YouTube app? How can I perform an arbitrary search in the Xbox YouTube app?

Posted On: March 25, 2023
Admittedly I haven't played with the Xbox YouTube app much. I looked through various tabs and menus and could not find a way to perform a keyword search. Is there a way? Question from user EBon...[More]


Is the Infini-Lift Lightspeed worth it? Is the Infini-Lift Lightspeed worth it?

Posted On: September 30, 2023
In Tiny Tower (iOS), is the Infini-Lift Lightspeed worthwhile? It's fairly expensive at 499 Bux. Does it have any special features or is it just faster? Question from user cagcowboy at stackexc...[More]


Is the missable chest in the Mushroom Castle still in the remake? Is the missable chest in the Mushroom Castle still in the remake?

Posted On: November 26, 2023
In the original Super Mario RPG on SNES, there is a missable hidden treasure chest that could only be obtained by jumping on a Toad's head the first time you visit Mushroom Castle. Once you enter ...[More]


Using - execute command, how do I check if a block is one of multiple possibilities? Using - execute command, how do I check if a block is one of multiple possibilities?

Posted On: April 8, 2024
Using an /execute command, I want to check if a certain block is, for example, either oak_fence, OR iron_bars.However, in my specific case, I can't just use two command blocks to check for either one ...[More]


How to setup Xbox Series S|X for a family? How to setup Xbox Series S|X for a family?

Posted On: March 7, 2023
I'm new to Xbox and have created an account for me and my children and have linked them to as a family. Will all members of the family be able to play if I login and setup the Xbox with my acco...[More]


Shiny Unicorn in Hogwarts Legacy Shiny Unicorn in Hogwarts Legacy

Posted On: July 18, 2023
I have a shiny unicorn!! Super proud of myself cuz I’ve never found one before. Not sure what to name him? Question from user oogieboujie at HogwartsLegacyGaming at reddit. Answer: I fo...[More]