Missing Structure Fix - Modded structure cleaner for minecraft. Removes all references to non-existent structures to allow for clean error logs and chunk saving. The program goes through every chunk, in every region file of the world, removing the relevant structure reference
and structure start
tags.
Designed to fix worlds suffering from the [MC-194811] Missing structures will destroy saved worlds bug, where uninstalling a mod which generated custom structures causes the world to become unstable.
Fixes errors such as Unknown structure start: <missing structure>
, Failed to save chunk
⚠ This does not work on 1.18.x worlds. ⚠
- Install Python 3.x Currently not compatible with Python versions past 3.10
- Install the requirements Matcool's Anvil Parser and Gooey. This can be done with the following commands:
pip install anvil-parser
pip install Gooey
- Download the latest release (MCStructureCleaner_v16.zip) from the releases page and extract it.
- Find the names of the structure tags you want to remove. I recommend using NBTExplorer.
- Install MCStructureCleaner then double click on
main.py
to run the program. - You should see an interface like this.
- Now, you can fill out each section:
tag
: The exact name of the structure tag you want to remove. This is case sensitive. You can input many tags at once, separated by spaces. If the names have spaces in them, you can surround them with quotes. For example,"my structure" "another structure"
. Leave this field blank if you want to delete ALL NON-VANILLA STRUCTURE TAGS.jobs
: The number of threads you want to run it on. Default: 2 x CPU logical processors. In my experience, the default works well enough.path
: The path to the world folder. (The whole folder, not just theregion
folder)output
: The path to the output folder. This is where the cleanednew_region
will be saved. If you leave this blank, the cleaned world will be saved in the same folder as MCStructureCleaner.region
: The dimension you want to clean. If you leave this blank it will clean the overworld.DIM-1
is the nether,DIM1
is the end.
- For example, this input will delete all occurances of "Better Mineshaft" and of "Better Stronghold" in the world "MyWorld", in the Nether (DIM-1), using 8 threads. The world folder is located in the user's minecraft saves, and the output will be saved to the desktop.
- Once you have filled out all the sections, click
Start
to begin the process. This may take a while, especially if you have a larger world. - If there is an error, it will be displayed in the
Output
section. If there is no error, the program will sayDone!
and you can close the program. - Now you may rename the output folder (called
new_region
) toregion
and replace the oldregion
folder in your world. Don't forget to backup your world first! - Enjoy your now working world 😊
Only recommended if the GUI does not work on your device
-
Run main.py with any of the following parameters. I recommend using NBTExplorer to find the name, or just letting the program fix all non-vanilla names by not inputting any tag.
-h
For help on command line arguments.-t
For the tag you want removed, in quotes. Leave empty if you wish to remove ALL NON-VANILLA TAGS.-j
For the number of threads you want to run it on. Default: 2 x CPU logical processors.-w
For the name of the world you want to process. Default: "world".-p
For the path to the world you want to process. Default: current directory.-r
For the name of the sub-folder (dimension) in the world. Default: "".-o
For the path of the folder where the new region folder will be saved to. Default: current directory.- Example 1: This command will delete all non-vanilla structures (defined up to 1.17) in the overworld of the world "SMP"
python main.py -w "SMP"
- Example 2: This command will delete all occurances of "Better Mineshaft" and of "Better Stronghold" in the world "MyWorld", in the Nether (DIM-1), using 8 threads. The world folder is located in the user's minecraft saves, and the output will be saved to the desktop.
python main.py -t "Better Mineshaft" "Better Stronghold" -j 8 -r "DIM-1" -p "C:\Users\X\AppData\Roaming\.minecraft\saves\MyWorld" -o "C:\Users\X\Desktop"
If you are on windows, I recommend using PowerShell.
-
Let it run. This may take a while, depending on the power of your computer and the size of your world.
-
Replace the contents of your region folder with the contents of new_region.
-
Enjoy your now working world 😊
- Always back up your worlds before making any changes to them.
- Structure specific effects that remained after uninstalling the mod will no longer work for the removed structures (This includes locating structures and custom loot tables).
- If you have corrupted region files (With the wrong data format, or a size of 0b) the script may crash.
Clone the repository, then install requirements:
pip install -r requirements.txt
pip install -r tests/requirements.txt
Most standard linters are fine as long as the code is readable, the project files are currently linted with flake8.
- VSCode: the testing environment is already configured, simply press the
Run Tests
button added by the official Python Extension. - Command Line:
pytest -v --cov=. tests/ --cov-report xml:cov.xml
- Expected coverage: The
structurecleaner
folder should have 100% coverage.
- Generate your expected input files and output files. This can be done easily by running the program on a world, and then copying the region folder to the
tests
folder, and renaming it toexpected_input
andexpected_output
respectively. However, for new formats it is important to thoroughly check the output or make it by hand with NBTExplorer! - Place them in the directory
tests/data/X
where X is the name of the test. (See other tests for reference) - Use
remove_tags_test
in thetests
directory to create your test. (See other tests for reference) - Run pytest. The coverage should be the same as before, and the test should pass.
Contributions are always welcome! See the issues page for ideas, or feel free to suggest your own ideas.
- Feel free to message me on discord (Nyveon#9999) or twitter (Nyveon) if you need help using it.
- Why did we make this? To save our own SMP world after uninstalling some mods and getting the MC-194811 error. We had spent a lot of time on it, and didn't want anyone else to have to lose their world to the same bug.
- Thanks to @DemonInTheCloset for contributing to multiprocessing and command line arugments.
- Thanks to @lleheny0 for contributing to file validation.
- Pre 1.12: The bug does not apply to these versions.
- 1.13.x: 🟡 Manually
- 1.14.x: 🟠 Untested, but should work
- 1.15.x: 🟢 Automatically
- 1.16.x: 🟡 Manually
- 1.17.x: 🟠 Untested, but should work
- 1.18.x: 🔴 Not working. anvil-parser is not compatible with 1.18.x yet.
- 1.19.x: ❔ The bug might be fixed in this version. If anyone has information, please let me know c: