Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-194811

Missing structures will destroy saved worlds

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.16.1, 20w30a, 1.16.5, 1.17.1
    • None
    • Windows 10 build 18363
    • Community Consensus
    • Custom Worlds, Save Data, Structures
    • Important
    • Platform

      If a vanilla structure's name is changed in the structure registry or is removed, re-entering an already existing world will spam the log with 

      Failed to read chunk [x, z] 
      net.minecraft.util.crash.CrashException: Loading NBT data
      Failed to store chunk [x, z] 
      java.lang.NullPointerException: null
      Unknown structure start: <missing structure>
      Couldn't load chunk [-246, -125] 
      java.util.concurrent.CompletionException: net.minecraft.util.crash.CrashException: Loading NBT data

      and many other issues also including java.io.DataInputStream and java.io.DataOutputStream

       

      Even worst, the player will be able to move around in the world and place/remove blocks but when they exit and re-enter, the world does not save their progress due to the try/catched crash in the chunk saving.

      This is a serious issue with how Minecraft does not double check to make sure a structure exists before saving/reading it from memory and will heavily impact Mojang if they ever decide to remove a structure or rename an existing one. The solution would be to fix the bug by checking if structures exist before writing it to memory and when reading it from memory, check again to make sure it exists before storing it into the chunk. That way this bug does not explode or limit Mojang in the future. Right now, this bug is badly hitting the modding community with adding/removing structures so that's why this bug report exists to help make sure Mojang is aware of this issue so they won't get surprised when it happens to them as well.

      A workaround right now is to use a third party app like NBTExplorer, go into the world's region files and enter every chunk's mca file, go into the chunk's level > structures > references and remove the missing structure manually from the chunk. However, this will take forever as there's hundreds if not thousands of chunks created in any decently lived world.

      I hope this helps!

      Edit: I just attached a world filled with missing structures. Upon entering said world, the game will lag, the logs will be spammed, and chunks will not be saved properly anymore.

      This can be recreated in any world to simulate removal of structures by going into the world's region folder, opening several .mca with a program like NBTExplorer, go into the chunk's Level, then into Structures, then add long tags into References and Start with names of structures that doesn't exist such as "sky:castle_village" and save. Then enter the world and that chunk when loaded will cause all the issues stated here. For easiness, use the attached saved world to debug and confirm the bug.

            Unassigned Unassigned
            TelepathicGrunt TelepathicGrunt
            Votes:
            29 Vote for this issue
            Watchers:
            22 Start watching this issue

              Created:
              Updated:
              CHK: