I know I can get them by toggling f3, but It would be much more efficient, in my opinion, to just display it without a toggle.
24 Answers
In Minecraft Pocket Edition (from 0.16.0) you can use the command /tp ~ ~ ~, which teleports the current player to the current location. This command has the side effect of displaying the coordinates it teleported to.
This should work on the PC version as well, but I don't have access to that just now.
1I'm sorry, but currently, there is no way to do this (that I am aware of) without using thousands of command blocks to detect each separate position and display a message for each. I hope I'm wrong, but I believe there is no way to currently do this easily
3You can do it with one command block using the command:
/execute positioned as <username> run teleport <username> ~ ~4 ~ Note: this is VERY specific with the coordinates displayed in chat.
Minecraft 1.13 and newer versions allow this to be done without teleporting the player:
/data get entity @s Pos 1