Operating System Linux

How to Fix a Corrupt Minecraft World on a Linux Server with Region Fixer

Back up a damaged Minecraft Java world, scan it with Minecraft Region Fixer on Python 3, then replace broken chunks from a backup or let the game regenerate them.

A crash, a full disk or a server killed in the middle of a save can leave a Minecraft Java Edition world with damaged chunks: the server throws errors while loading an area, players are kicked when they walk into it, or the world refuses to load at all. This guide shows how to scan a world on a Linux server with Minecraft Region Fixer, replace broken chunks from a backup, or remove them so the game generates them again. The commands work on any current distribution with Python 3, including Ubuntu 26.04 and 24.04 LTS, Debian 13 and AlmaLinux 9 / Rocky Linux 9.

Not every world can be saved. Region Fixer repairs the region files that hold terrain; a chunk that is deleted comes back as freshly generated terrain, without anything players built there. A recent backup is always the better fix, and the tool can use one for you.

What Region Fixer does and its current status

Minecraft Region Fixer is an open-source Python program (GPL-3.0) maintained at github.com/Fenixin/Minecraft-Region-Fixer. The repository is not archived and received commits in 2025 and 2026; the last tagged release is v0.3.6 from August 2022. The release notes name Minecraft 1.17 and 1.18.1 as supported world formats and do not list newer versions, so on a newer world always work on a copy first and check the result before you put it back.

The program runs only on Python 3; the Python 2.7 build instructions found in older tutorials are obsolete. It detects corrupted chunks, chunks stored in the wrong place, chunks sharing the same offset, chunks with too many entities and region files that are too small. It also reads level.dat and the player .dat files and warns about problems in them, but it does not repair those files.

Requirements

  • Shell access to the server as the user that owns the Minecraft files (the examples use a user with sudo rights and a server in /opt/minecraft with the world in /opt/minecraft/world).
  • Python 3 and Git.
  • Enough free disk space for a full copy of the world.

Check for Python 3:

python3 --version

Install Python 3 and Git if they are missing. On Ubuntu and Debian:

sudo apt update
sudo apt install python3 git

On AlmaLinux and Rocky Linux:

sudo dnf install python3 git

Step 1: Stop the server and back up the world

Never scan or repair a world while the server is running. Stop it from its console with the stop command, or stop its service if you run it under systemd (the unit name depends on how you installed it):

sudo systemctl stop minecraft

Then archive the world folder exactly as it is, damage included. If a repair goes wrong you can return to this state:

cd /opt/minecraft
tar -czf ~/world-before-repair-$(date +%F).tar.gz world

If your server software keeps the Nether and the End in separate folders such as world_nether and world_the_end, add them to the same command.

Step 2: Download Region Fixer

Clone the repository into your home directory. The libraries it needs are included in the repository, so nothing has to be installed with pip:

cd ~
git clone https://github.com/Fenixin/Minecraft-Region-Fixer.git
cd Minecraft-Region-Fixer

Print the option list. Option names have changed between versions, so treat this output as the reference for the copy you downloaded:

python3 regionfixer.py --help

Step 3: Scan the world

A scan only reads; it changes nothing. Point the program at the world folder (the one that contains level.dat). The -p option sets how many processes scan in parallel, and -l writes a list of every problem to a file:

python3 regionfixer.py -p 4 -l ~/scan.log /opt/minecraft/world

At the end you get a summary with the number of chunks in each problem category. Add -v to print one line per region file instead of a progress bar. In that output c counts corrupted chunks, w wrong-located chunks, tme chunks with too many entities, so chunks sharing an offset and t the total.

If the scan reports no problems, the world files are structurally sound and the cause is elsewhere: a plugin or mod, a broken player file, or level.dat (see the FAQ).

Step 4: Repair the world

Choose the least destructive option that applies. After each run, scan again to see what is left.

Replace bad chunks from a backup

If you have an older copy of the world, extract it next to the live world and let Region Fixer copy the healthy version of each broken chunk across. --backups takes one or more world folders separated by commas, tried in order:

python3 regionfixer.py -p 4 --replace-corrupted --backups /opt/minecraft/backups/world-monday,/opt/minecraft/backups/world-sunday /opt/minecraft/world

Players lose only what changed in those chunks since the backup was made.

Try to fix chunks in place

The current code can attempt to recover data from corrupted chunks and move wrong-located chunks to the coordinates stored inside them:

python3 regionfixer.py -p 4 --fix-corrupted --fix-wrong-located /opt/minecraft/world

Delete chunks that cannot be recovered

Without a usable backup, remove the corrupted chunks. Minecraft generates new terrain in their place the next time a player goes there, and anything built in those chunks is gone:

python3 regionfixer.py -p 4 --delete-corrupted /opt/minecraft/world

The other problem categories have matching --delete-… and --replace-… options; check --help for the exact names.

Remove entity overloads

A chunk crammed with thousands of entities (a mob farm gone wrong, item drops in a loop) can freeze or crash a server without being corrupted. This removes all entities from chunks that hold more than the given number:

python3 regionfixer.py -p 4 --delete-entities --entity-limit 500 /opt/minecraft/world

Step 5: Start the server and check

Make sure the files still belong to the account that runs the server, then start it and watch the log while you visit the areas that were broken:

sudo systemctl start minecraft
sudo journalctl -u minecraft -f

If the result is worse than before, stop the server, move the world folder aside and unpack the archive from Step 1.

Preventing the next corruption

  • Always shut the server down with stop, and give the service enough time to finish saving before systemd kills it.
  • Keep free disk space; a full disk during a save is a common cause of truncated region files.
  • Take regular backups while the server is stopped or after save-off and save-all flush in the console (re-enable saving with save-on), and keep several generations so Region Fixer has something to restore from.

Frequently asked questions

The server says level.dat is corrupt. Can Region Fixer repair it?

No, it only reports problems in that file. Minecraft keeps the previous copy as level.dat_old in the world folder. With the server stopped, rename the broken level.dat out of the way and copy level.dat_old to level.dat, then start the server.

Does the Minecraft server have a built-in repair option?

The server jar accepts --forceUpgrade, which rewrites every chunk to the current format on start-up, with --eraseCache to discard cached data such as light and heightmaps so they are recalculated, and --recreateRegionFiles to rebuild the region files during the upgrade. These are world upgrade options, not corruption repair, but they can clear lighting glitches and leftovers from old versions. Back up first and remove the options again after one start.

Does this work for Bedrock Edition worlds?

No. Bedrock Edition stores worlds in a LevelDB database, not in Anvil region files, and Region Fixer cannot read it. Restore a Bedrock world from a backup.

Can I run the scan on my own computer instead of the server?

Yes. Download the world folder, install Python 3 and run the same commands; the program also works on Windows and macOS. Upload the repaired world while the server is stopped.

Share story:

Continue reading other guides on How VPS.