The bug
When you have an entity riding another entity, and save it in a structure, only the bottom entity gets saved.
How to reproduce
Save a structure which includes an entity riding another entity
Load the structure
Notice how the structure only loads the bottom entity.
Notes
Reloading the world does not fix the issue
I am not playing on peaceful mode.
Code analysis
Based on 1.11 decompiled using MCP 9.35 rc1
This happens because the method net.minecraft.world.gen.structure.template.Template.addEntitiesToWorld(World, BlockPos, Mirror, Rotation, StructureBoundingBox) calls the method net.minecraft.entity.EntityList.createEntityFromNBT(NBTTagCompound, World) to create the entity. However, this method cannot load Passengers entities. Instead the method net.minecraft.world.chunk.storage.AnvilChunkLoader.readWorldEntityPos(NBTTagCompound, World, double, double, double, boolean) could be called with the vector values and true to only try to spawn the entity but don't force it.
Edit: The passengers have to get a new random UUID as well, therefor this method cannot be used.
Linked issues
is duplicated by 6
relates to 1
Attachments
Comments 26
Added a video describing this bug: https://www.youtube.com/watch?v=FlQQ8dPSc5Q
I experienced the same, just save you'r /summon command on commandblock with auto:1b