I'd like to know exactly when the <playername>.dat
files are saved on the server. (I'd like to run a script that tracks the players' locations and inventories, and this is crucial to whether this script will work or not.)
1 Answer
I decompiled the Minecraft server version 1.2.5 using the Minecraft Coder Pack and quickly stumbled through the code:
The players inventory and location gets saved into the <playername>.dat
when:
- The server stops
- The player disconnects
So one possible way to go if you wanted to keep track of your players locations and inventories would be to use an event-based plugin wrapper such as Bukkit and write a plugin which does whatever you want with the players information as soon as he disconnects (or at any other time).
If you cannot or do not want to use Bukkit, you could possibly try to monitor file updates with a third-party software.
-
The script runs every few minutes and it logs the data from the .dat files... The whole idea is to see what the player is doing while they are online, so I'd need something that makes the server update the files regularly... Thanks for the input. May 18, 2012 at 22:18
-
You're welcome. The server by itself will not update the files more reqularly, your only way here would be using some sort of modification to the server, either using a wrapper such as Bukkit, or to change the source-code yourself.– PitMay 18, 2012 at 22:26