1

I want to find the “file” or the data that has my current coordinates and use my real time coordinates to be read by a program I’m designing in an IDE. Is there a way to do find my player coordinates in real time? I’ve looked into NBTExploerer, but it looks like it only saves my coordinates when I quit the program.

  • 1
    I could be totally wrong, but I imagine there isnt a file that has this. If there was a file that constantly kept track of the players coordinates, it would need to constantly be written too every time the players coords change, even if its a decimal change. With players running or flying very fast, it would potentially be written too thousands of times a second which would probably destroy most computers and make the game very very laggy. Maybe its feasable if it was done on another thread, but again I feel like eventually if the user moved too fast for too long the cpu would still overload. – Kyle Rone Mar 27 at 19:38
1

The game saves about every 45 seconds, so this would be the best accuracy you'd get reading the player.dat file. If you want real-time, probably the easiest approach would be to play on a server and plug your program into the communication, e.g. modifying an open-source tool like Bungeecord which acts as a proxy merging multiple servers. Extracting the player position from the client-server communication would provide you with best real-time accuracy.

0

I'm not sure if you need right-this-millisecond accuracy on the positions. Sampling the position once per second would be significantly easier, and probably less wasteful in terms of resources and data usability.

That being said though, there are two types of solutions that come to mind. Push, or pull. Either way would require the use of a custom mod. The mod could

  • Push
    • Sample the data and push it through a socket/RMI connection that you've opened in the IDE.
  • Pull
    • Have the IDE extension poll the current position at the frequency you want, making the mod just a "give me the position now" provider. The mod would then become either an RMI target, or a server socket, or something similar.

How to do those things I think might be a question better suited for game dev/stackoverflow.

0

I only use Java Edition, so haven't tried this, but Bedrock Edition appears to have a coding interface: https://minecraft.gamepedia.com/Code_Connectionhas

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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