mojira.dev
MC-154210

Block loot table dynamic contents doesn't work for chests or barrels

Adding a set_contents function of type dynamic and name contents to the chest or barrel loot table doesn't make them keep their items when broken.

{
  "function": "minecraft:set_contents",
  "component": "minecraft:container",
  "entries": [
    {
      "type": "minecraft:dynamic",
      "name": "minecraft:contents"
    }
  ]
}

An empty BlockEntityTag.Items nbt is added to the dropped item instead

tag: {BlockEntityTag: {Items: []}}}

Adding set_contents with named entries does work though.

I assume this is because the Java code for chests and barrels remove the items from the container before the nbt is updated, and shulker boxes must be the other way around?

Removing set_contents from the shulker_box loot table does stop it from keeping it's contents, and adding a type dynamic contents entry will make it drop it's contents. So it all works as expected for shulker boxes, but it should work for all containers (please).

Comments 0

No comments.

Valkon

(Unassigned)

Confirmed

(Unassigned)

Minecraft 1.14.2, 1.16.4, 1.20.4, 1.20.5 Release Candidate 2

Retrieved