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 is this hole for in the controller? What is this hole for in the controller?

Posted On: November 28, 2023
So I was changing the trigger springs in my controller this evening and I noticed a small hole in the back of the controller, which I can only assume to be a reset perhaps? What is this hole actual...[More]


How do I reach the top of this tower of The Erebus Reactor? How do I reach the top of this tower of The Erebus Reactor?

Posted On: May 10, 2023
In Episode 2 Mission 6: The Erebus Reactor of Dusk there's collection of tall towers with metal girders connecting them all through the stage. There's quite a few items found throughout these ...[More]


How do I get back to the Dunes after entering the Steamworks on the Genocide Route? How do I get back to the Dunes after entering the Steamworks on the Genocide Route?

Posted On: April 9, 2024
I am doing a Genocide Route run of Undertale Yellow. After finishing the Dunes and entering the Steamworks, I realized I had accidentally missed an item that would help with the final boss. The Golden...[More]


How can I complete Desert Snakes in Forza Horizon 5? How can I complete Desert Snakes in Forza Horizon 5?

Posted On: April 3, 2023
I have been trying to complete the challenge in Forza Horizon 5 Rally Adventure, but although the timer starts when I leave Valle de Foráneos, I do not get a waypoint to follow. I have tried...[More]


In what way is super mario advance 2 less difficult than the original game? In what way is super mario advance 2 less difficult than the original game?

Posted On: March 2, 2024
The Wikipedia article for Super Mario World states that the Gameboy Advance version (Super Mario Advance 2) has a 'toned down difficulty' compared to the original game. However, I am curious as to how...[More]


What are some tactics to fortify villages and their population against outside attack? What are some tactics to fortify villages and their population against outside attack?

Posted On: January 29, 2023
I recently discovered my homely village has been ransacked by a marauding horde of zombies. They managed to get inside one of my large apartment houses and wiped out all but two (!) of the village pop...[More]


Is there a way to play the campaign only and avoid a large download in Call of Duty: Modern Warfare Remastered? Is there a way to play the campaign only and avoid a large download in Call of Duty: Modern Warfare Remastered?

Posted On: April 23, 2024
So, today I got Call of Duty: Modern Warfare Remastered 50% off to play the campaign. Upon buying it, I get two things in my Steam library: MWR MP and MWR. Now, I started with just the MWR one because...[More]


Floo Flames in Hogwarts Legacy Floo Flames in Hogwarts Legacy

Posted On: March 24, 2023
LoL anybody else in here make it a point to visit every last floo flame on the map shortly after u got ur broom? I'm like 16 hours into the game and barely %25 done with the game  Question...[More]


Reach the compartment before it closes in Agent A: A Puzzle in Disguise Reach the compartment before it closes in Agent A: A Puzzle in Disguise

Posted On: July 9, 2023
In chapter 3, there is a button on the ground to the right of a platform in the center of the room. Clicking the button opened a compartment on the left side of the platform. The compartment keeps clo...[More]


Minecraft Texture Pack on Server over FTP Minecraft Texture Pack on Server over FTP

Posted On: June 7, 2023
Today I tried to "install" a texture pack on my server (verygames) to let all my users use the same texture pack.To do this, I found a way with editing the server.properties at line "resource-pack=".I...[More]