The bug
NBT tags of entities and tile entities which refer to block positions or entity UUIDs are not treated specially. This causes entities to spawn at the old position where they were saved or entities to refer to other entities which do not exist anymore because new UUIDs were assigned.
NBT tag detecting
The problem is that currently not every NBT tag has its own data parameter and the data parameter does not contain information about what it actually stores. Because of that these tags need to be hardcoded.
If at some point every tag has its own data parameter, it could contain information like:
UUID of self
UUID of other
Position of self
...
and then there could be a single method which removes tags with "Position of self" and save "Position of other" as relative coordinates.
Possible structure file representation
Affected tags (last updated for 16w39c)
Entities
Entity(class)Pos
EntityLiving(class)LeashX,Y,ZUUIDMostUUIDLeast
horseOwnerUUID
llamaOwnerUUID
EntityTameable(class)OwnerUUID
zombie_pigmanHurtBy
shulkerAPX,APY,APZ
vexBoundX,BoundY,BoundZ
EntityThrowable(class),EntityArrow(class),EntityFireball(class), (EntityFishHook(class))xTile,yTile,zTile
area_effect_cloudOwnerUUIDMost,OwnerUUIDLeast
ender_crystalBeamTargetX,Y,Z
item_frame,paintingTileX,TileY,TileZ
shulker_bulletOwnerL,MX,Y,Z
TargetL,MX,Y,Z
Tile Entities
TileEntity(class)x,y,z
end_gatewayExitPortalX,Y,Z
Nested data
Entities
Entity(class)Passengers
spawner_minecartSpawnDataSpawnPotentialsEntity
falling_blockTileEntityData
itemItem
potionPotion
donkey,llama,muleItems
Horse types
SaddleItem
llamaDecorItem
horseArmorItem
item_frameItem
chest_minecart,hopper_minecartItems
fireworks_rocketFireworksItem
EntityLiving(class),armor_standArmorItemsHandItems
villagerInventoryRecipesList entry:
buybuyBsell
Tile entities
mob_spawnerSpawnDataSpawnPotentialsEntity
brewing_stand,furnace,shulker_box,hopper,dropper,chestItems
jukeboxRecordItem
beaconPaymentItem
Items
Block item creating tile entity
BlockEntityTag
Items spawning entities
EntityTag
Commands (?)
Entities
commandblock_minecartCommand
Tile entities
command_blockCommand
signText1,Text2,Text3,Text4
Items
written_bookpages
Linked issues
is duplicated by 6
relates to 2
Attachments
Comments 18
That tag doesn't exist when the entity gets loaded; it's only used for the initial spawn, and then removed.
Can confirm on 21w18a, demonstrated here with a spider jockey. The spider loses the Passengers tag, so the skeleton doesn't spawn.
Â
@@unknown, this report is only about block positions and entity UUIDs not being written and read correctly, the (outdated) list in the description only mentions cases where the UUID would have to be adjusted.
For passengers not being loaded, see MC-103452.
Great compilation. Do you have a list of tickets we should link to this one?