Loot tables of type minecraft:block
are unaffected by the Luck attribute despite evidently providing the "this"
entity loot context. As such, the bonus_rolls
and quality
tags are completely ignored. This is different from chest and archaeology loot tables which handle Luck correctly.
Steps to reproduce
Download the attached data pack “block_luck_test.zip” and add it to either a new or an existing world. This data pack replaces the loot table
minecraft:blocks/dirt
and is set up the following way:Dirt blocks always drop a diamond. This is just to test whether the loot table has been parsed and applied correctly at all.
Dirt blocks drop a piece of coal if the mining player is currently sneaking. This is to test whether the loot table has access to the entity context.
Dirt blocks (theoretically) drop an iron ingot if the mining player’s Luck attribute is at least 1. This is to test whether the loot table respects Luck.
Place a bunch of dirt blocks and switch to Survival mode if not already.
Mine some dirt blocks without any potion effects active and without sneaking.
Mine some dirt blocks without any potion effects active, but while holding down the sneak key.
Give yourself Luck (either through the
/effect
command or by drinking a Potion of Luck from the Creative inventory) and mine some dirt blocks again. Sneaking is irrelevant for this third test.
Expected results
Each dirt block mined drops a diamond regardless of conditions.
While the player is sneaking, each dirt block mined additionally drops a piece of coal.
After the Luck effect has been applied, each dirt block mined additionally drops an iron ingot.
Observed results
Each dirt block mined drops a diamond regardless of conditions. ✔
While the player is sneaking, each dirt block mined additionally drops a piece of coal. ✔
After the Luck effect has been applied, the loot from mined dirt blocks does not change. ❌
Confirmed in 1.21.5 (apparently I can’t edit my own reports anymore?)