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

NBT tags storing block positions or entity UUIDs are not written and read correctly in structures

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.10.2, Minecraft 16w39c, Minecraft 16w44a, Minecraft 1.11.2, Minecraft 1.12, Minecraft 1.12.2, Minecraft 18w20c, Minecraft 18w22a, Minecraft 1.13-pre1, Minecraft 1.13-pre3, Minecraft 1.13-pre6, Minecraft 1.13-pre7, 1.15.2, 1.16.2, 1.16.3, 1.16.5, 21w18a
    • Confirmed
    • Structures
    • Low
    • Platform

      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

      See this reddit discussion

      Affected tags (last updated for 16w39c)

      Entities

      • Entity (class)
        • Pos
      • EntityLiving (class)
        • Leash
          • X, Y, Z
          • UUIDMost
          • UUIDLeast
      • horse
        • OwnerUUID
      • llama
        • OwnerUUID
      • EntityTameable (class)
        • OwnerUUID
      • zombie_pigman
        • HurtBy
      • shulker
        • APX, APY, APZ
      • vex
        • BoundX, BoundY, BoundZ
      • EntityThrowable (class), EntityArrow (class), EntityFireball (class), (EntityFishHook (class))
        • xTile, yTile, zTile
      • area_effect_cloud
        • OwnerUUIDMost, OwnerUUIDLeast
      • ender_crystal
        • BeamTarget
          • X, Y, Z
      • item_frame, painting
        • TileX, TileY, TileZ
      • shulker_bullet
        • Owner
          • L, M
          • X, Y, Z
        • Target
          • L, M
          • X, Y, Z

      Tile Entities

      • TileEntity (class)
        • x, y, z
      • end_gateway
        • ExitPortal
          • X, Y, Z

      Nested data

      Entities

      • Entity (class)
        • Passengers
      • spawner_minecart
        • SpawnData
        • SpawnPotentials
          • Entity
      • falling_block
        • TileEntityData
      • item
        • Item
      • potion
        • Potion
      • donkey, llama, mule
        • Items
      • Horse types
        • SaddleItem
      • llama
        • DecorItem
      • horse
        • ArmorItem
      • item_frame
        • Item
      • chest_minecart, hopper_minecart
        • Items
      • fireworks_rocket
        • FireworksItem
      • EntityLiving (class), armor_stand
        • ArmorItems
        • HandItems
      • villager
        • Inventory
        • Recipes
          • List entry:
            • buy
            • buyB
            • sell

      Tile entities

      • mob_spawner
        • SpawnData
        • SpawnPotentials
          • Entity
      • brewing_stand, furnace, shulker_box, hopper, dropper, chest
        • Items
      • jukebox
        • RecordItem
      • beacon
        • PaymentItem

      Items

      • Block item creating tile entity
        • BlockEntityTag
      • Items spawning entities
        • EntityTag

      Commands (?)

      Entities
      • commandblock_minecart
        • Command
      Tile entities
      • command_block
        • Command
      • sign
        • Text1, Text2, Text3, Text4
      Items
      • written_book
        • pages

        1. shulker_test.nbt
          0.7 kB
        2. 2024-06-06_16.29.19.png
          2024-06-06_16.29.19.png
          487 kB
        3. 2021-05-10_17.24.13.png
          2021-05-10_17.24.13.png
          576 kB
        4. 2018-05-23_10.20.47.png
          2018-05-23_10.20.47.png
          171 kB
        5. 2018-05-23_10.14.14.png
          2018-05-23_10.14.14.png
          137 kB
        6. 2018-05-23_09.56.29.png
          2018-05-23_09.56.29.png
          190 kB
        7. 2018-05-23_09.54.39.png
          2018-05-23_09.54.39.png
          125 kB
        8. 2018-05-23_09.54.20.png
          2018-05-23_09.54.20.png
          136 kB
        9. 2018-05-23_09.51.30.png
          2018-05-23_09.51.30.png
          125 kB

            Unassigned Unassigned
            marcono1234 Marcono1234
            Votes:
            40 Vote for this issue
            Watchers:
            24 Start watching this issue

              Created:
              Updated:
              CHK: