Breaking a container (chest, hopper, dispenser...) with a custom loot table before opening it ignores quality and luck modifiers.
Using this loot table as an example:
{"pools":[{"rolls":1,"entries":[{"type":"item","weight":100,"name":"minecraft:leather_helmet","functions":[{"function":"set_attributes","modifiers":[{"name":"null","attribute":"generic.luck","operation":"addition","amount":3,"slot":"head"}]}]},{"type":"item","weight":1,"name":"minecraft:dirt","quality":100000}]}]}
What I expected to happen:
near 100% chance (100/101) for a helmet with +3 luck if the player has 0 (or theoretically any nonpositive) luck
near 100% chance (300,001/300,101) for dirt if the player has that +3 luck
What actually happened:
When the chest was broken before being opened, the helmet would have the same 100/101 chance to drop regardless of luck-enhancing equipment or the luck effect. Opening it normally (with m2) does, however, do what was expected.
Steps to reproduce:
1. Create the custom aforementioned loot table and load it into a world.
2. Setblock some chests with said LootTable.
3. Break the chests without right-clicking them and observe the drops.
Relates to MC-92759