mojira.dev
MC-103452

Structure blocks don't load passenger entities

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

  1. Save a structure which includes an entity riding another entity

  2. Load the structure

  3. 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.

Related issues

Attachments

Comments

migrated
[media][media][media][media]
migrated

I experienced the same, just save you'r /summon command on commandblock with auto:1b

migrated

Added screenshots of my polar bears lonely without their riders. Would love to see this fixed!

migrated

Added a video describing this bug: https://www.youtube.com/watch?v=FlQQ8dPSc5Q

migrated

Still persisting in 18w05a.

migrated

Thanks, Daniel. I hope we get a fix for this, someday!

AlexMCool

Confirmed for 18w16a

migrated

Confirm 19w09a 

and special case for leads: a leashed animal will be leashed to the original fence (if possible)

Nethonos

Confirm 1.14

Nethonos

Confirmed for 1.14.1 Pre-Release 1

Nethonos

Confirmed for 1.14.1 Pre-Release 2

migrated

We've almost reached the third birthday for this bug.  Still watching!  And still using command blocks as work arounds.

Nethonos

Confirmed for 1.14.2 Pre-Release 2

Nethonos

Confirmed for 1.14.2 Pre-Release 3

Nethonos

Confirmed for 1.14.2 Pre-Release 4

Ray

still in 1.15 pre 6

Ray

in 1.16RC1

pulpetti

In 1.16.1 and 20w29a

migrated

can confirm for 21w07a

clamlol

Affects 1.17.1

clamlol

Affects 22w03a.

[media]

I see that MC-105317 was recently fixed so hopefully the devs will explore the intricacies of structure blocks and entities a bit more in the coming snapshots.

Brain81505

Can confirm in 1.19.4

Lejus

Can confirm in 1.20.1

Conure512

Confirmed in 1.20.2

Minecraft386882

Confirmed in 1.21.3

Ray

(Unassigned)

Confirmed

Platform

Normal

Structures

entity, nbt, passengers, structure_block

Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w33a, Minecraft 16w35a, Minecraft 16w44a, ..., 1.20.1, 1.20.2 Pre-release 1, 1.20.2, 24w35a, 1.21.3

Retrieved