-1

I have a server and would like to now if it is possible to print the X,Y,Z coordinates of a player, and how to do this.

New contributor
Tin Vulovic is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • 5
    Possible duplicate of Print XYZ of nearest Villager (or other entity) – pppery Jul 31 at 13:40
  • @ppery while that is definitely helpful; that post does not state how to refer to a player as an entity. I don't see code like '@e[type=player', so if the semantics are unknown to the person seeing that answer, they can't figure out how to adapt it to work for players instead of a villager). It solves 90% of this problem, but not 100%, not an exact duplicate. Maybe you could include the semantics in an answer here and link to that other answer for the remainder of the code? Both for nearest and a specific player? – aphid 2 days ago
  • @aphid I'd flag the hypothetical question "how do I take this command that works with villagers and make it work with players instead' as a duplicate of What are the basics of commands in Minecraft Java Edition, so there's no scope for an answer here and the question should be closed regardless. – pppery 2 days ago
  • Nice, now we can close it, as a random person coming from google should be able to find an answer using both links. – aphid 2 days ago
-1

/execute as PLAYER/TARGET run execute at @s run tp @s ~ ~ ~

this teleports a target to its current location. I tested it on a bunch of chickens so I should work.

The server console should be able to see the feedback from this command, thus showing the coordinates of a player/mob.

Change PLAYER/TARGET to your desired target. @a will select all players

be careful tho because and error in this command could tp everyone to the world spawn

| improve this answer | |
New contributor
Ironotor is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.