-
Bug
-
Resolution: Fixed
-
1.17, 1.17.1, 1.19.3, 1.20.2
-
None
-
Confirmed
-
Loot tables
Issue
After updating to 1.17 I discovered that the set_count function for a loot table only outputs a single item to the player when it had previously given the intended amount throughout the 1.16 releases. Note this applies to all count settings including exact, range, and binomial. The error only applies to unstackable items such as saddles and minecarts, in 1.16 multiple slots would be filled with a single unstackable item but now there is only one.
Recreate
Recreating this issue is simple and all you have to do is create a loot table with one roll that uses a function to set the count of an item. To assist with this report I have attached raw code, screenshots showing the transition between versions, and a map in 1.16.5 that contains all of the necessary loot tables.
Code 1: set_count exact (format 2)
{ "type": "minecraft:entity", "pools": [ { "rolls": 1, "entries": [ { "type": "item", "weight": 1, "name": "minecraft:saddle", "functions": [ { "function": "set_count", "count": 2 }, { "function": "set_nbt", "tag": "{CustomModelData:7}" }, { "function": "set_name", "name": [ { "text": "Exact Format 2", "color": "white", "bold": "true" } ] } ] } ] } ] }
Code 2: set_count range
{ "type": "minecraft:entity", "pools": [ { "rolls": 1, "entries": [ { "type": "minecraft:item", "name": "minecraft:saddle", "functions": [ { "function": "minecraft:set_count", "count": { "min": 2, "max": 4 } }, { "function": "minecraft:set_nbt", "tag": "{CustomModelData:7}" }, { "function": "minecraft:set_name", "name": [ { "text": "Range", "color": "white", "bold": true } ] } ] } ] } ] }
Code 3: set_count binomial
{ "type": "minecraft:entity", "pools": [ { "rolls": 1, "entries": [ { "type": "minecraft:item", "name": "minecraft:saddle", "functions": [ { "function": "minecraft:set_count", "count": { "type": "minecraft:binomial", "n": 4, "p": 1 } }, { "function": "minecraft:set_nbt", "tag": "{CustomModelData:7}" }, { "function": "minecraft:set_name", "name": [ { "text": "Binomial", "color": "white", "bold": true } ] } ] } ] } ] }
Notes
At first I thought it was because of the format I used to compress NBT data into one line. However, after changing the format I realized that this has no effect.
Code 4: Compressed NBT (format 1)
{ "function": "minecraft:set_nbt","tag": "{display:{Name:'{\"text\":\"Exact Format 1\",\"color\":\"white\",\"bold\":true}'},CustomModelData:7}" }
Code 5: Simplified NBT (format 2)
"functions": [ { "function": "set_count", "count": 2 }, { "function": "set_nbt", "tag": "{CustomModelData:7}" }, { "function": "set_name", "name": [ { "text": "Exact Format 2", "color": "white", "bold": "true" } ] }
- is duplicated by
-
MC-237908 Cannot drop multiple totems of undying with custom loot table
- Resolved