mojira.dev
MC-122536

"set_nbt" function in loot table does not merge NBT to item

The bug

"function": "set_nbt" in loot tables does nothing. Loot tables that worked in 1.12 don't show an error when loaded, but when the item is dropped the NBT data is not applied to it. This causes, for example, uncraftable potions in fishing and uncraftable arrows dropped by strays.

Code analysis

It appears that in 17w48a's bka class, the NBT data from the item is merged to the NBT data from the table, but is not merged back onto the item.

Linked issues

Attachments

Comments 4

Side note: I can see 2 things wrong: ench's id and lvl are fully lowercase, no capitals, and set_count is not needed if it's 1.

Thanks. I have corrected those. I wondered if perhaps the formatting had become stricter and that would fix it, but alas it still doesn't work.

It also affects the default loot tables eg: Strays drop uncraftable arrows and fishing yields uncraftable potions

Can confirm. This bug is currently driving me up the wall. First it was MC-121379, and now this. Darn. I'm never gonna be able to get my function pack to 1.13.

Richard A. Hallett

Nathan Adams

Confirmed

Minecraft 17w47b, Minecraft 17w48a

Minecraft 17w49a

Retrieved