How to Fix Player Data Corruption in Minecraft
Fix corrupt player data files (.dat) in Minecraft servers. Covers login crashes, missing inventories, UUID issues, and player data recovery.
How to Fix Player Data Corruption in Minecraft
The Problem
Server crashes when specific player logs in
java.lang.NullPointerException at net.minecraft.server.players.PlayerList.placeNewPlayer
Player joins with empty inventory and at world spawn
java.io.IOException: Failed to read player data
Each player's data (inventory, position, health, ender chest, advancements) is stored in a .dat file in world/playerdata/. The filename is the player's UUID. When this file is corrupted, the player either cannot log in (server crashes) or logs in with reset data.
Quick Fix
Find the player's UUID using a lookup tool like mcuuid.net. Navigate to world/playerdata/ and find the matching .dat file. If the server crashes on login, delete the file (the player loses their inventory and spawns at world spawn). If you have a backup, restore the file from the backup instead.
Step-by-Step Diagnosis
- Identify the player. The crash report or log mentions the player name or UUID. If only the UUID is shown, look it up at mcuuid.net.
- Locate the dat file. Player data is in
world/playerdata/<uuid>.dat. The UUID is in lowercase with dashes:12345678-abcd-efgh-ijkl-123456789012.dat. - Check the dat_old backup. The server creates
<uuid>.dat_oldas a backup before each save. If the.datfile is corrupt, try using the.dat_oldversion. Rename.datto.dat_brokenand rename.dat_oldto.dat. - Inspect with NBTExplorer. Open the
.datfile in NBTExplorer. If it opens, check for invalid entries (empty inventory tags, null position values, etc.). If it fails to open, the file is unrecoverably corrupt. - Restore from backup. If you have a server backup, extract just the player's
.datfile from the backup and replace the corrupt one. - Delete as last resort. If no backup exists and the file is unreadable, delete it. The player joins as if they are new: at world spawn with an empty inventory. Their ender chest, advancements, and statistics are also reset.
Common Causes
- Server crash during player save. The server saves player data when they disconnect and during auto-save intervals. A crash during this write produces a partial file.
- Plugin modifying player data incorrectly. Plugins that write custom NBT data to the player file can introduce invalid tags. This is a plugin bug.
- Online/offline mode switch. When a server switches between
online-mode=trueandonline-mode=false, player UUIDs change. The old player data becomes orphaned under the old UUID, and the player starts fresh. - Disk full during save. Writing to a full disk truncates the output file.
- Manual editing errors. If someone edited the dat file with an NBT editor and saved invalid data, the file becomes corrupt.
Recovering Inventory Without a Backup
If the player data file is corrupt but the player can still log in (just with empty inventory), there is no way to recover the exact inventory without a backup or a plugin that logs inventory contents. Some economy plugins maintain separate databases with player balance data that survives player data resets. Enderchest contents are stored in the player data file and are lost with it.
FAQ
Does deleting a player's .dat file ban them?
No. Deleting the file resets the player to a new state. They can still log in. They spawn at world spawn with an empty inventory, zero XP, and no advancements.
Can I transfer player data between servers?
Yes, if both servers use the same online-mode setting. Copy the .dat file to the new server's world/playerdata/ folder. The UUID must match, so both servers must be online-mode or both offline-mode.
How do I prevent player data corruption?
Run automated backups, use the stop command for clean shutdowns, and avoid plugins that modify player NBT data directly. Paper includes safer player data saving than Spigot.
Need a server that handles all this? Astroworld Hosting, NVMe SSDs, Pterodactyl panel, DDoS protection on every plan.