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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: Minecraft 1.14.2
    • Fix Version/s: None
    • Labels:
      None
    • Confirmation Status:
      Unconfirmed
    • Category:
      (Unassigned)

      Description

      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",
        "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).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Valkon Valkon
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: