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:
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.
- relates to
-
MC-79154 Hoppers occasionally duplicate items
- Resolved
-
MC-110750 /spreadplayers command resets scoreboard data on chunk unload
- Resolved
-
MC-119971 Various duplications, deletions, and data corruption at chunk boundaries, caused by loading outdated chunks — includes duping and deletion of entities/mobs, items in hoppers, and blocks moved by pistons, among other problems
- Resolved
-
MC-89610 Entites on a team gets kicked off the team and scores reset when unloaded
- Reopened