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]

In SeriousSam, How do I get this body armour located in Tomb Of Ramses III? In SeriousSam, How do I get this body armour located in Tomb Of Ramses III?

Posted On: March 24, 2023
I'm at the Tomb Of Ramses III in Serious Sam HD, and there is some body armour located at the top of an area previously containing an Arachnoid. I'm unable to find anyway up to this area. . ...[More]


How can I keep monsters out of my nether regions? How can I keep monsters out of my nether regions?

Posted On: January 24, 2017
In order to find myself some nice lapis lazuli and get away from my current base, I'm building a little tunnel in the Nether to allow me to get into the midst of some fresh chunks fairly quickly.I hav...[More]


How to do Road to Freedom quest? How to do Road to Freedom quest?

Posted On: January 23, 2023
I started the Road to Freedom quest but the marker on the map disappeared and I am not sure what to do at this point? How do I progress with this quest? Question from user Matas Vaitkevicius at ...[More]


Frequency of the Golden Bowser Train? Frequency of the Golden Bowser Train?

Posted On: January 28, 2023
Does anyone happen to know how often you can go to the Golden Bowser Train? For those that don't yet know, it is a level with nothing but coins, and is a great way to bolster your extra lives.Questio...[More]


What did you think was the worst quest in Hogwarts and why? What did you think was the worst quest in Hogwarts and why?

Posted On: March 4, 2023
Alright so before any of you answer, you should know I might pick you're comments out for a youtube video so if that's, not what ya down for, then let me know in that comment! . For me 2 qu...[More]


How do I get the space shuttle launch in Gameboy Tetris? How do I get the space shuttle launch in Gameboy Tetris?

Posted On: February 12, 2023
I've been playing Tetris on the virtual Gameboy console on my Nintendo Switch. As a kid, with an actual Gameboy, I remember getting to see a space shuttle launch after doing well enough on an A-Ty...[More]


With proper aim can an Ambassador always one-shot a sniper? With proper aim can an Ambassador always one-shot a sniper?

Posted On: January 29, 2023
I'm working on my Skullpluggery achievement for Spy. For a while I thought it was straight-forward -- just point, pause (for accuracy), and fire. Worked everytime, until lately, where my lucky str...[More]


Command to say player coords in chat? 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...[More]


Are the Professor Layton and the Curious Village download puzzles still available? Are the Professor Layton and the Curious Village download puzzles still available?

Posted On: March 12, 2023
I just recently bought Professor Layton and the Curious Village (EU version) to play on my 3DS. It has a feature to download extra puzzles over the internet. My question is, are these puzzles st...[More]


Optimal percentages for maximum profit and experience when buying and selling for each customer Optimal percentages for maximum profit and experience when buying and selling for each customer

Posted On: January 15, 2023
Does anyone know the optimal buying/selling percentages of normal, increased and decreased-priced items to get the maximum experience points (high chance of pin bonus and customers should accept at fi...[More]