Loot tables cannot be applied to blocks with Custom Inventories

Published by WenXin2 on
Issue description

Currently, dungeon loot tables cannot be applied to custom blocks with custom inventories attached.

For example, if I use the command below and apply it to a chest, I can open the chest to find dungeon loot. But if I run the same command on a custom block with an inventory, it will not have any loot inside. This would make custom structures that contains custom chests with loot possible.

Attached is my workspace, the revelant elements are named CrateGUI and AzureCrate.

/data merge block ~ ~-2 ~ {LootTable:"chests/simple_dungeon"}

Issue comments

You are welcome! I am glad I could help :) If you like what we do, consider donating to us to help us keep this project up.

I'm not sure if I'm doing something wrong, but with b20316 when I ran the command for the Loot Table, its not being applied to the block with the inventory.

I tested and it worked. But I had to specify absolute coordinates, or offset myself properly above the chest to apply. Same happened with vanilla chests.

Also:

]
            }
          ],
          "name": "natureplus:azure_crate
        }

One of your loot tables has broken JSON and it has locked code so I guess it's a typo when you were editing it.

Thanks! I got it working. Turns out, it was simply because the code for the crate was locked when I added waterlogging to it.