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]

Is it just me or does Professor Hecat from Hogwarts Legacy look like Gabbie Hanna? Is it just me or does Professor Hecat from Hogwarts Legacy look like Gabbie Hanna?

Posted On: September 23, 2023
When I first played the game and saw this professor my first thought was “She looks like someone”. Then I was like woah, Hecat looks similar to Hanna!. Question from user weather_it_be ...[More]


Does completing Sly 1 to 100% give anything other than artistic content? Does completing Sly 1 to 100% give anything other than artistic content?

Posted On: July 29, 2023
I completed Sly Cooper and the Thievius Raccoonus from The Sly Collection (PS3). I got the platinum trophy, but the game isn't 100%. I've completed the "Master Thief Sprint" in a cou...[More]


How to mute squad member in Call Of Duty Warzone 2.0 DMZ How to mute squad member in Call Of Duty Warzone 2.0 DMZ

Posted On: February 22, 2023
I'm playing in a party and a specific team mate is very loud in the channel. Some people suggest that I can mute them in the Channels menu, but I can see no MUTE option at all in the corner. ...[More]


Redstone door lock (memory cell) Redstone door lock (memory cell)

Posted On: March 30, 2024
I want to make a pvp map which has 2 spawnpoints on the map. The spawnpoints are closed off with an iron door. The teams can both get ready by flipping a lever. Now i want to make it so when both team...[More]


How much Gold would Zevlor have given me for killing the Goblins? How much Gold would Zevlor have given me for killing the Goblins?

Posted On: November 11, 2023
After defeating a camp of goblins and returning to Emerald Cove, I was greeted by the Tiefling Zevlor. He thanked me for killing the Goblins so they could safely travel to Baldur's Gate. He said h...[More]


Any tips for a new Hogwarts player? Any tips for a new Hogwarts player?

Posted On: July 9, 2023
No spoilers though please!. Question from user 5195cd at HogwartsLegacyGaming at reddit. Answer: Collect field pages this will help you to level up quickly. Use Revelio at all times. . ...[More]


Anyone else doing this in Hogwarts Legacy? Anyone else doing this in Hogwarts Legacy?

Posted On: March 11, 2023
Just curious if anyone else is trying to be good and stay away from the Dark Arts. I have yet to spend any talent point in it. I never use the spells, however I did learn them. The reason behind me...[More]


Minecraft Powering a redstone torch on a block adjacent to a redstone lamp without powering the lamp Minecraft Powering a redstone torch on a block adjacent to a redstone lamp without powering the lamp

Posted On: April 1, 2023
Would it be possible to power the redstone torch in this configuration without powering the redstone lamp? Question from user Looky1173 at gaming.stackexchange.com. Answer: I assume by "...[More]


Defeating the helicopter in Split Second Defeating the helicopter in Split Second

Posted On: January 24, 2023
I'm having some trouble in the episode where you're supposed to defeat the helicopter. I do pretty well in the episodes where you're supposed to avoid the helicopter fire. I must be missing a power ...[More]


Is Hogwarts Legacy worth getting? Is Hogwarts Legacy worth getting?

Posted On: August 16, 2023
I recently got a Steam gift card and I’ve been wanting this game but I read some of the reviews and some people were saying that the game got stale after a while. What do you think about this? ...[More]