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]

Yurgir Fight Yurgir Fight

Posted On: December 16, 2024
This is a tip for fighting Yurgir in the Shar Temple. I tried fighting him a half dozen times and died each time. The combination of creatures aiding him and the grenades took me out too quickly. The ...[More]


Can I progress without doing isobel’s fight encounter? Can I progress without doing isobel’s fight encounter?

Posted On: November 25, 2023
I think I’ve reloaded my save 6 or 7 times trying to save this & I can’t for the life of me make it happen. I think the closest I’ve gotten has been getting Marcus down to like 3...[More]


What is the difference between Minecraft java edition and bedrock edition? What is the difference between Minecraft java edition and bedrock edition?

Posted On: March 14, 2024
I have just recently started playing Minecraft again after a 4 or 5 year hiatus (java edition ~v1.8 apparently), so I have a couple questions:.What's the difference between Minecraft Java Edition and ...[More]


Rocket League controller only works on Press Any Button to Start screen Rocket League controller only works on Press Any Button to Start screen

Posted On: September 17, 2023
When I start Rocket League, I press a button on my controller at the screen that says "Press Any Button to Start". That brings up the main menu, but my controller no longer works to control ...[More]


What determines Ranalds Gift in Warhammer Vermintide 2? What determines Ranalds Gift in Warhammer Vermintide 2?

Posted On: May 29, 2023
Ranald's Gift seemingly gives random amounts of progress towards loot boxes. What determines how much progress you get? Or is it purely RNG? Question from user NoBugsOnlyFeatures at gaming.stac...[More]


Do pawns take their inventory with them when they leave your party? Do pawns take their inventory with them when they leave your party?

Posted On: April 23, 2024
As I have been exploring the countryside I often bump into pawns who would like to join my party. Sometimes they are higher level than the folks already accompanying me, so I tend to add them and dism...[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]


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]


This game is BYO immersion This game is BYO immersion

Posted On: July 13, 2023
Regarding the conversation on how immersive this game is / how immersive it could be: I’ve been having a delightful time doing a kind of DIY immersion. Here’s what I do:. return to the ...[More]


How does the Hard Light Swords damage scale with gun marks? How does the Hard Light Swords damage scale with gun marks?

Posted On: April 7, 2023
The Hard Light Sword's description says it "Deals critical damage depending on the number of gun marks on the target". How exactly does the damage scaling work? How much extra damage get...[More]