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

Order of chunk unloading, executing commands and removing unloaded entities causes problems

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Awaiting Response
    • None
    • Minecraft 1.9.2, Minecraft 1.11, Minecraft 1.12.2, Minecraft 17w48a
    • Confirmed
    • (Unassigned)

      The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.

      The bug

      When a chunk gets unloaded the entity in the chunk are added to the list net.minecraft.world.World.unloadedEntityList. When all entities are updated this list is cleared and the entities are removed from the list of loaded entities.
      The problem is that commands are executed after a chunk is unloaded, but before the entities are unloaded:

      Call order (MCP 9.24 beta)
      1. Removing unloaded chunks ("Minecraft Server" line 767 -> "World Server" line 200)
      2. Commands ("Minecraft Server" line 767 -> "World Server" line 216)
      3. Updating entities ("Minecraft Server" line 778)
      

      This causes bugs like MC-96131 where a chunk is unloaded, a command (or possibly something else as well) loads the chunk, the entities are not removed and their data becomes reset.

            Unassigned Unassigned
            marcono1234 Marcono1234
            Votes:
            19 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: