mojira.dev
MC-270134

Loot table set_count function does not function properly when combined with max_stack_size component on items that have lower stack limits

To reproduce:

1. Attempt to give yourself 64 stackable-to-64 saddles using the following loot table.

/loot give @s loot {"pools":[{"rolls":1,"entries":[{"type":"minecraft:item","name":"minecraft:saddle","functions":[{"function":"minecraft:set_count",count:64},{"function":"minecraft:set_components","components":{"minecraft:max_stack_size":64}}]}]}]}

❌ See that you only get one saddle.

2. Attempt to give yourself 64 stackable-to-64 armor stands by using the following loot table:

/loot give @s loot {"pools":[{"rolls":1,"entries":[{"type":"minecraft:item","name":"minecraft:armor_stand","functions":[{"function":"minecraft:set_count",count:64},{"function":"minecraft:set_components","components":{"minecraft:max_stack_size":64}}]}]}]}

❌ See that you only get only 16 armor stands.

set_count is capped by the default max_stack_size component of the item id, rather than properly obeying the max_stack_size component provided in the loot table.

Comments 1

Please mark this issue as invalid. Proper behavior can be observed if the set_count function is placed after the set_components function instead of before.

CreeperMagnet_

(Unassigned)

Confirmed

Commands, Loot tables

24w13a

Retrieved