How to Recover a Corrupted Minecraft World
Diagnose and repair a corrupted Minecraft world using region file surgery, NBTExplorer, chunk editors, and backup restoration when your server won't load.
Recognizing World Corruption
Corruption does not always announce itself with a crash. Sometimes it is subtle: a cluster of chunks that reverted to their original terrain as if nobody ever built there. Players logging in to find their inventory has reset to what it was days ago. Entities, item frames, armor stands, mobs, vanishing from a specific area while the rest of the server is fine. The server log may show messages like Failed to load chunk, ChunkLoadError, or Error reading level.dat.
In more severe cases, the server will not start at all. You see a crash report referencing RegionFile or NBTException, or the console loops on "Preparing spawn area" without ever finishing. These are all signs that one or more files on disk are damaged.
Common Causes
- Unclean shutdown, killing the Java process, power loss, or the hosting node crashing while chunks were being saved to disk. This is by far the most common cause.
- Disk full, when the disk runs out of space mid-save, the write operation truncates and the file is left incomplete.
- Faulty storage hardware, dying SSDs or HDDs can silently corrupt data sectors.
- Buggy plugins, rare, but some world-manipulation plugins can write invalid data to region files if they crash during an operation.
- Force-killing during
/save-all, the server was in the middle of flushing all chunks and got interrupted.
Step 1: Restore From Backup
The easiest and most reliable fix. If you have a recent backup, restore it and accept the data loss between the backup timestamp and now. This is almost always preferable to spending hours trying to surgically repair corrupted files. Check your Pterodactyl panel backups, your automated backup plugin archives, or any off-site copies you have stored.
If you do not have a backup, or if the backup itself is too old to be useful, continue with the repair steps below.
Step 2: Delete session.lock
Sometimes the world is not actually corrupted, the server just thinks another instance is using it. Minecraft writes a session.lock file inside each world folder to prevent two servers from loading the same world simultaneously. If the server crashed without cleaning up this file, the next startup attempt may refuse to load the world.
Stop the server, delete world/session.lock (and world_nether/session.lock, world_the_end/session.lock if they exist), and try starting again. This is harmless and fixes the problem surprisingly often.
Step 3: Use --forceUpgrade
Paper and Spigot support a --forceUpgrade startup flag that forces the server to re-process all chunks through the world upgrader. This can fix minor data format inconsistencies. Add it to your startup command:
java -Xmx4G -jar paper.jar --forceUpgrade
The server will take significantly longer to start as it processes every chunk. Watch the console for errors, if it manages to load successfully, remove the flag and restart normally. This flag does not fix region file corruption, but it handles cases where chunk data is valid but in an outdated internal format.
Step 4: Identify and Remove Corrupted Region Files
This is where the actual surgery begins. Minecraft worlds are stored as region files in world/region/, named r.X.Z.mca. Each file contains 32x32 chunks (a 512x512 block area). If specific chunks are causing crashes, you can identify the problematic region file and delete it, causing the server to regenerate that terrain from the world seed.
Check your server logs for lines like:
[Server thread/ERROR]: Chunk file at [12, -5] is missing level data, skipping
[Server thread/ERROR]: Failed to load chunk at region file r.0.-1.mca
The numbers in the error messages tell you which region file is corrupted. Navigate to world/region/, find the offending .mca file, and either delete it or move it out of the folder. When the server starts, it will regenerate fresh terrain for that region using the world seed. Any player-built structures in that region are lost, which is why this is a last resort rather than a first step.
To calculate which region file contains a specific block coordinate: divide the X and Z block coordinates by 512 and round toward negative infinity. Block (1000, -300) is in region r.1.-1.mca.
Step 5: NBTExplorer for level.dat Repair
If the server fails to load with errors referencing level.dat, the world's metadata file is damaged. The level.dat file stores the world seed, spawn point, game rules, weather state, and other global settings. Minecraft automatically maintains a backup called level.dat_old. Try these steps:
- Stop the server.
- Rename
level.dattolevel.dat_broken. - Rename
level.dat_oldtolevel.dat. - Start the server.
If that does not work, download NBTExplorer (a free tool for editing NBT data) on your desktop machine. Open the broken level.dat file and look for obviously wrong values, a world seed of 0, missing Data compounds, or corrupted string fields. You can manually fix these values if you know what they should be (check your old configs or ask a player for the world seed).
Step 6: Chunk-Level Repair With Amulet or MCA Selector
For granular chunk-level editing, use Amulet Editor or MCA Selector. Both are desktop applications that let you open a world, visually inspect individual chunks, and delete or replace corrupted ones.
MCA Selector is particularly powerful for this use case. You can filter chunks by various criteria, for example, "show me all chunks that were last modified before January 2024", and delete them selectively. The server will regenerate deleted chunks from the seed. This is more precise than deleting an entire region file because you can preserve the good chunks within a partially corrupted region.
Step 7: CoreProtect as a Safety Net
If your server runs CoreProtect, its block change database is stored separately from the world files (usually in MySQL or SQLite). Even if the world is corrupted, CoreProtect's records of player actions may still be intact. After restoring the world from a backup or regenerating chunks, you can replay CoreProtect data to recover player builds that occurred between the backup and the corruption event.
This is not always possible, CoreProtect tracks changes, not absolute state, but it can recover a surprising amount of work if the plugin's database survived intact.
Preventing Future Corruption
- Always use
/stop, never kill the Java process, never usekill -9, never just close the terminal window. - Monitor disk space, set up alerts if your disk usage exceeds 85%. A full disk during a save operation will corrupt data.
- Run regular backups, see our automated backup guide. The best recovery tool is a good backup.
- Use a UPS if self-hosting, an uninterruptible power supply gives the server time to shut down safely during a power outage.
- Keep server software updated, Paper and Spigot regularly fix bugs that can cause data corruption under edge-case conditions.
World corruption is never fun, but in most cases you can recover the majority of your data using the steps above. The key is to start with the least destructive option (backups) and only escalate to file surgery when simpler methods fail.
Looking for reliable hosting? Astroworld Hosting runs NVMe SSD, Pterodactyl panel, daily backups, and DDoS protection. See features , plans from €6.39/mo.