If you create a structure using structure blocks, entities can be saved with the structure. If you load the same structure, the entities will have the same entity data as expected.
If however you make the structure generate in the world with a datapack, some entity data is ignored.
I can confirm this happening with:
"Size" for Magma cubes
"HandItems" for Zombified Piglins, Skeletons, Wither Skeletons, Strays and Vindicators (NOTE: "ArmorItems" is saved correctly)
"Passengers" for Minecarts
Does not affect "HandItems" for Piglins, interestingly.
Linked issues
is duplicated by 1
Attachments
Comments 3
The problem is that the game seems to overwrite the mobs' data. I made a wither skeleton with a shield and a netherite sword. When generated with a structure, only its sword was changed, because wither skeletons have a stone sword by default. The same with Size for magma cubes I assume. The game chooses a random size, and ignores the one stored in the structure file.
Could you attach a test data pack, please?