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]

Finished Far Cry Primal, but the play through is only at 54.02% Finished Far Cry Primal, but the play through is only at 54.02%

Posted On: August 24, 2023
I just finished Far Cry Primal. I played about 30 hours, and did all the (people) missions. I also build and crafted everything. I conquered all the towers and area's, and tamed all the b...[More]


In Star Wars Jedi Which song that Cal listens to on Bracca? In Star Wars Jedi Which song that Cal listens to on Bracca?

Posted On: May 7, 2023
When you start a new game, Cal is listening to a song that,  at least to me, sounds extremely like The Hu. However, I fail to recognize the specific song, and it is not part of the regular s...[More]


Waukeen's rest cannot be saved Waukeen's rest cannot be saved

Posted On: July 12, 2025
Hey all. I've just encountered Waukeen's Rest in my save; where I came through the mountain pass, beat Kith'rak Voss and his fellow githyanki soldiers and finally came upon the burning building. IMMED...[More]


This guy is worse than I thought This guy is worse than I thought

Posted On: January 14, 2025
I finally managed to finish a honor mode, and I made a choice I never made before. .This time I actually agreed to sign Raphael's contract for the Orphic Hammer because I really wanted to beat the gam...[More]


What can I do with Dragon Bones and Scales? What can I do with Dragon Bones and Scales?

Posted On: August 25, 2015
I've started slaying dragons (like all good Dohvakiin must), and with each beastie I down, I'm getting close to 200 lbs of loot, mostly in the form of Dragon Bones and Scales. These two items are high...[More]


How to unlock the Bandolier via ammo caches? How to unlock the Bandolier via ammo caches?

Posted On: March 17, 2024
Aside from buying the Bandolier as a tier3 item at the shop, I've read you can unlock it by other means, after accessing some secret exits in Chaos Generator and Marksman and hitting some switches. H...[More]


Can I save Burmano from Himself in Zelda Tears of the Kingdom? Can I save Burmano from Himself in Zelda Tears of the Kingdom?

Posted On: June 22, 2023
Darling Burmano is the in-house chef for Lookout Landing, and very early in my adventure, he asked for an apple. After completing this quest, the next time I returned to Lookout Landing, the Chef was ...[More]


How can I download Fancy Pants Adventures for offline play? How can I download Fancy Pants Adventures for offline play?

Posted On: March 13, 2024
Fancy Pants is one of the best flash games ever.Is there some way to download it, so that I can play it offline?Question from user Lazer at gaming.stackexchange.com.Answer:Right click and "Save As" th...[More]


What weapons do you associate with certain companions? What weapons do you associate with certain companions?

Posted On: March 17, 2026
So recently I googled "Lae'zel sword" and found two specific greatswords pop up, the soulbreaker sword and the silver sword of the astral plane. Personally, I associate Lae'zel with soulbreaker more, ...[More]


Stuck with the conjuration curse Stuck with the conjuration curse

Posted On: August 22, 2023
I have got 139/140 conjurations and I am missing the medium constructed decorations. All my collection chests are completed across the maps, I have checked the butterfly missions more than 5 times,...[More]