Mojira Archive
MC-248824

Loot table entry of type "dynamic" copies list reference rather than deep copying items

When using /loot replace ... to transfer the contents of a shulker box to another container (e.g. a chest) using this loot table (see below), the item list REFERENCE is transferred rather than the list contents being deep-copied. This results in a pair of "entangled" containers where removing any of the items from either container will result in the respective item being removed from the other.

minecraft/loot_tables/blocks/shulker_box.json:

{
  "type": "block",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        { 
          "type": "dynamic", 
          "name": "contents"
        }
      ]
    }
  ]
}

 

Setup:

  • Create a world (a flat world will do)
  • Download this datapack and enable it in the world (it only contains the loot table in question)
  • Place down a shulker box and a chest
  • Place items inside the shulker box
  • Run this command: /loot replace block <CHEST coords> container.0 27 mine <SHULKER BOX coords>
  • See that the contents of the shulker box seem to have been copied to the chest.

Observations:

 

  • When taking any items out of either the chest or the shulker box, the respective item will be removed from the other container, too
  • When destroying the chest (dropping all the items onto the ground), all the transferred items will no longer be in the shulker box
  • Putting items in either of the containers does not transfer them to the other, and they will not be deleted when either of the blocks is destroyed

Unresolved

DorkOrc

2022-02-26, 10:17 PM

2023-07-19, 07:21 AM

2

3

Confirmed

Low

Platform

Loot tables

1.18.2 Release Candidate 1, 1.19.3, 23w04a

-