
You open your survival world. Before you even see the terrain, you start taking damage. The death screen flashes. Your spawn point says "bed obstructed" even though your bed is sitting in the middle of a clear room. You respawn and your inventory is full of broken items showing red zeros instead of normal stack counts.
This is player data corruption. It happens when the game crashes or the server shuts down during a world save, cutting off the write process halfway through your player's data file. The file is partially written, so the game reads garbage values for your position, health, inventory, and spawn point.
Here is how to fix it without losing your entire world.
What Corrupted Data Looks Like
When player data gets corrupted, several things break at once:
- Position: Your XYZ coordinates might point to a location inside solid blocks, causing instant suffocation
- Inventory: Items show a stack count of 0 displayed in red. These items exist in the data file but with invalid count values
- Spawn point: The bed location data points to invalid coordinates, triggering the "bed obstructed" error even when the bed is fine
- Health: Your health value might be set to zero or negative, causing instant death on spawn
All of this comes from a single source: the .dat file in world/playerdata/ (for servers) or level.dat (for singleplayer) got corrupted during a failed save.
Fix 1: Use the Backup Player Data File
Minecraft stores a backup of your player data automatically. Before you do anything manual, check for this backup.
For servers:
- Stop the server
- Navigate to
world/playerdata/ - Look for files with the
.dat_oldextension. Each player has both a.datand a.dat_oldfile - Delete or rename the corrupted
.datfile - Rename the
.dat_oldfile to.dat - Start the server
For singleplayer:
- Close the game
- Navigate to your save folder (
.minecraft/saves/YourWorldName/) - You should see
level.datandlevel.dat_old - Delete
level.dat - Rename
level.dat_oldtolevel.dat - Open the game
This restores the last successful save. You might lose a few minutes of progress, but your inventory and position will be intact.
Fix 2: Edit the Player Data Manually
If no backup file exists, or the backup is also corrupted, you need to edit the NBT data directly.
- Download NBTExplorer from github.com/jaquadro/NBTExplorer
- Open the corrupted
.datfile (for servers, it is named with the player's UUID) - Find these tags and fix them:
| Tag | What It Controls | Fix |
|---|---|---|
| Pos (list of 3 doubles) | Player XYZ position | Change to coordinates you know are safe (like your spawn or base) |
| Dimension | Which world the player is in | Set to minecraft:overworld |
| Health | Current health | Set to 20.0 (full health) |
| foodLevel | Hunger bar | Set to 20 |
| SpawnX, SpawnY, SpawnZ | Bed spawn point | Set to the actual coordinates of your bed |
| Inventory | All carried items | See below |
Fixing inventory items with red zeros:
Inside the Inventory tag, each item has a Count field (a byte value). Corrupted items show Count: 0. You have two options:
- Change
Countto1(or whatever stack size you had) to recover the item - Delete the entire inventory entry if the item data is too corrupted to fix
After editing, save the file in NBTExplorer and restart your server or game.
Fix 3: Reset Player Data Completely
If editing individual tags is too tedious or the corruption is severe, you can reset the player completely.
For servers:
- Stop the server
- Delete the player's
.datfile fromworld/playerdata/ - Start the server
The player will spawn as if they are joining for the first time: at world spawn, with an empty inventory, and no bed spawn. They lose all items and their position, but the world itself is untouched.
For singleplayer:
Delete the level.dat file and the playerdata folder inside your save, but keep the region folder. This preserves all your builds and terrain but resets player state.
Preventing Corruption
Player data corruption happens almost exclusively during interrupted saves. Here is how to prevent it:
- Do not force-kill the server process. Always use the
/stopcommand or the panel's stop button. Killing the Java process withkill -9or closing the terminal bypasses the shutdown save - Enable autosave intervals. On Paper servers, the default autosave runs every 6000 ticks (5 minutes). Do not disable this
- Keep backups. Automated daily backups of the
world/folder give you a clean restore point. On Space-Node servers, you can use the built-in file manager to download backup copies of your playerdata folder at any time
Quick Summary
| Problem | Cause | Fix |
|---|---|---|
| Suffocating on login | Position saved inside blocks | Edit Pos tag in NBT or restore .dat_old backup |
| Red zero items | Stack count corrupted to 0 | Edit Count byte in NBT Inventory entries |
| Bed obstructed | Spawn point coordinates invalid | Edit SpawnX/Y/Z or break and replace the bed in-game |
| Instant death | Health saved as 0 or negative | Edit Health tag to 20.0 |
If you run your server on Space-Node, the support team will help you repair corrupted player data files. Check the plans here.
