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.
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.
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
- Sample the data and push it through a socket/RMI connection that you've opened in the IDE.
- 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.
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