Minecraft – When do the player data files update in Minecraft SMP servers

minecraft-java-editionserver-administration

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.)

Best 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.