The bug
When applying loot tables to containers, the contents of barrels cannot be modified.
How to reproduce
Apply a
/data merge
command to a barrel to give it a loot table/data merge block ~ ~-1 ~ {LootTable:"minecraft:chests/buried_treasure"}
→ ❌ Contents will not be altered
Try using the
/setblock
command/setblock ~ ~ ~ minecraft:barrel{LootTable:"minecraft:chests/buried_treasure"}
→ ❌ The barrel will not have the loot table contents
All commands used worked properly on chests and shulker boxes but not barrels.
Confirmed, Barrels don't have the LootTable and LootTableSeed NBT stored at all, meaning they can't be applied.
Same for smokers, blast furnaces (since furnaces can hold loot tables), and brewing stands (they can naturally generate in villages and igloos)