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]

What are these green and orange dots on the Soviet Installation map? What are these green and orange dots on the Soviet Installation map?

Posted On: August 22, 2023
I am playing Rise of the Tomb Raider on PC. When I press the TAB key, I get the map, and I see (red arrow highlighted) green/orange dots and dotted lines. What do they mean? How can these be use...[More]


Minecraft doesnt launch with the Ultrasurf proxy? Minecraft doesnt launch with the Ultrasurf proxy?

Posted On: June 7, 2023
I often go to the library to play Minecraft. Since there are a lot of people playing there, enough people put in the wrong credentials such that the library IP is often temporarily banned from the Moj...[More]


In Zelda TOTK, Is there a way to select a material for all arrows? In Zelda TOTK, Is there a way to select a material for all arrows?

Posted On: May 18, 2023
When aiming a bow, pressing ↑ opens the Materials list "Select a material to attach.". Is there a way to avoid having to open this menu for every arrow that you fire, if you wanted t...[More]


Is it possible to do a 100% playthrough with a single save file? Is it possible to do a 100% playthrough with a single save file?

Posted On: October 4, 2023
I was thinking of doing my next playthrough to complete 100% of the game (I sort of rushed my first time), on the highest difficulty. Do I need to have multiple saves for branching scenarios, or is it...[More]


Export Dance Central Pictures Export Export Dance Central Pictures Export

Posted On: March 23, 2023
How do you export the pictures/animated gifs from Dance Central? Question from user St. John Johnson at gaming.stackexchange.com. Answer: Short Answer. You cannot export the pictures or vi...[More]


Damn, Minthara. Just pop off I guess. Damn, Minthara. Just pop off I guess.

Posted On: October 30, 2024
Question from user AcidicJester at BaldursGate3 at reddit.com.Answer:As long as we have spell slots, we win the game.Answer from user Parking_Put_1701 at BaldursGate3 at reddit.com....[More]


Ask anything Ask anything

Posted On: September 28, 2024
My brother brought it and i am planning on playing it too, but before that i wanted to do this and make fun of it when i finish it so.Question from user Choice_Knowledge_577 at BaldursGate3 at reddit....[More]


Be honest: did any parts in BG3 make you cry? Be honest: did any parts in BG3 make you cry?

Posted On: July 14, 2024
Anything from misty eyes and sniffles to bawling your eyes out will count! ?.I can think of a few (and mind you, I get really attached to the sympathetic NPC's in the games I play!):.Astarion's defea...[More]


Most Frustrating Thing Ever in Hogwarts Legacy Most Frustrating Thing Ever in Hogwarts Legacy

Posted On: April 20, 2023
I have 139 out of 140 conjurations. Fairly certain I found all the butterflies and the chests in the Vivarium's so now I have to start all over again and recheck them all. Question from user...[More]


Will Minecraft librarian villagers sell Mending books at tier 1? Will Minecraft librarian villagers sell Mending books at tier 1?

Posted On: June 5, 2023
I'm currently interested in finding a librarian villager that sells Mending enchanted books, since I have been fishing forever and it's just too slow. My logic is once I find a single Mendi...[More]