This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Kenzo's profile picture

Finding player coords on a command comp?

Started by Kenzo, 20 March 2016 - 02:00 AM
Kenzo #1
Posted 20 March 2016 - 03:00 AM
is there a way to find player coords using command comp? i have seen the way where it says their coords but i want to be able to store the coords soon as i find them. Any idea?
Bomb Bloke #2
Posted 20 March 2016 - 03:37 AM
Other than getting text output from the tp command, none that I'm aware of. Commands only output bools and sometimes strings anyways - that's simply the nature of Minecraft's command block system.
Wergat #3
Posted 20 March 2016 - 02:50 PM
When using the teleport method, the player will get "stuck in place" for a tick, because you teleport him to the place he is in. This is really annoying for the player if used a lot.
A much more smooth method of doing this, is to teleport an armor stand to that player and then get the position of that ArmorStand via /entitydata.
Parsing the NBT data of the /entitydata is pretty difficult, i will release a api to make that easier in the next week if you have time you might want to wait for that. If you need it urgent, you can text me to get a Beta version of that.
Kenzo #4
Posted 21 March 2016 - 12:08 AM
i want to know the player coords at all times, so it is going to be updated quite frequently. would placing a armour not get annoying?
Wergat #5
Posted 21 March 2016 - 01:14 AM
Yes it does, but its still less noticeable than getting teleported. Of course you would need to disable all of the ArmorStands slots and make it Invisible. The total duration is longer than a teleport (3/2 Commands instead of 1), but for all the things i was working with, the ArmorStand method was useable and almost unnoticeable, even when checking twice a second. You might want to change your concept so you do not need to get the player's position all the time, instead only when really required for whatever you need it.
Bomb Bloke #6
Posted 21 March 2016 - 07:02 AM
To my understanding, the tp "jerkiness" is fixed in MC 1.8, FWIW.
moTechPlz #7
Posted 21 March 2016 - 01:28 PM
You can install a mod who adds a find player coordinate command.