Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-103452

Structure blocks don't load passenger entities

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w33a, Minecraft 16w35a, Minecraft 16w44a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.1, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13b, Minecraft 17w15a, Minecraft 17w16b, Minecraft 17w17b, Minecraft 17w18b, Minecraft 1.12 Pre-Release 2, Minecraft 1.12.2, Minecraft 18w05a, Minecraft 18w16a, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 19w08b, Minecraft 19w09a, Minecraft 1.14, Minecraft 1.14.1 Pre-Release 1, Minecraft 1.14.1 Pre-Release 2, Minecraft 1.14.2 Pre-Release 2, Minecraft 1.14.2 Pre-Release 3, Minecraft 1.14.2 Pre-Release 4, Minecraft 1.14.2, 1.14.4, 1.15 Pre-release 6, 1.15.2, 20w07a, 1.16 Release Candidate 1, 1.16, 1.16.1, 20w29a, 21w07a, 1.17.1, 1.18.1, 22w03a, 1.20.1, 1.20.2 Pre-release 1, 1.20.2, 24w35a, 1.21.3
    • Confirmed
    • Structures
    • Normal
    • Platform

      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.

        1. 2017-04-15_00.07.10.png
          493 kB
          Tyruswoo
        2. 2017-04-15_00.07.34.png
          236 kB
          Tyruswoo
        3. 2017-04-15_00.12.54.png
          467 kB
          Tyruswoo
        4. MC-103452.png
          9 kB
          [Helper] clam lol

            Unassigned Unassigned
            Rays Ray
            Votes:
            97 Vote for this issue
            Watchers:
            31 Start watching this issue

              Created:
              Updated:
              CHK: