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]

How do I reset my sensor to track Shrines in Zelda Tears Of The Kingdom? How do I reset my sensor to track Shrines in Zelda Tears Of The Kingdom?

Posted On: May 31, 2023
I set my sensor to track the location of an item from the Hyrule Compendium. How do I reset it to start tracking Shrines again? Question from user Stevoisiak at gaming.stackexchange.com. Answer:...[More]


Whats the most efficient Minecraft mining strategy? Whats the most efficient Minecraft mining strategy?

Posted On: December 28, 2022
When I'm not exploring fresh caves or lands in minecraft, I'm busy trying to find deposits of diamond, gold and iron deep in the earth. So far I've just been digging around just above bedrock on a whi...[More]


What's the Path of Least Resistance for Honor Mode? What's the Path of Least Resistance for Honor Mode?

Posted On: November 11, 2025
I really wanna get it done, I know the basics, talk down Lump and the goblins in the village, wander around and get Karlach, free Slazza, what's everything that you should be doing to get high enough ...[More]


What happens if you break the Old Barbarian Statue in Clash of Clans? What happens if you break the Old Barbarian Statue in Clash of Clans?

Posted On: July 11, 2023
As the title asks, what happens if you break (the original) Old Barbarian Statue in the builders base? I have looked online but there isn't much continuity in what it does. Some sources say you ge...[More]


Downloading windows version of steam games on a mac to copy over to a pc Downloading windows version of steam games on a mac to copy over to a pc

Posted On: June 9, 2023
I am sharing an internet connection with a few roommates and have a data cap. I would love to be able to use my MacBook to download games onto it, create Steam backups and install them on Windows. ...[More]


Which house do you find to be the coziest? Which house do you find to be the coziest?

Posted On: September 19, 2023
I have done a play through as 3 of the four houses (Ravenclaw, Slytherin, and Gryffindor). I find that Gryffindor is more cozy than the other two. Might just be because the colors are warmer. Hufflepu...[More]


Should I reset Should I reset

Posted On: October 7, 2025
I’ve recently beaten kethric thorm and no have the problem of my level is too low and there is simply not enough creatures to fight to raise it to a spot where the difficulty is fair and fun.I’m l...[More]


What's the most visually satisfying effect or ability? What's the most visually satisfying effect or ability?

Posted On: October 16, 2023
What abilities or effects are the most appealing visually for you? My top contenders divine smite and fireball. Smite especially when it's an unexpected smite on a crit. Not knowing it's co...[More]


Astarion hates me? Astarion hates me?

Posted On: September 28, 2023
Help, Astarion dislikes everything i do and every decision i make. Do i need to be a bad person in order him to like me? I love helping people and speaking to animals (i'm a druid) but he seems to...[More]


Do you ever cast other smites over Divine as Paladin? Do you ever cast other smites over Divine as Paladin?

Posted On: April 26, 2026
Like thunderous smite for example.Question from user Cagedglobe at BaldursGate3 at reddit.com.Answer:Thunderous Smite is decent; Thunder damage is a good type of damage, and knocking enemies prone giv...[More]