-
Bug
-
Resolution: Invalid
-
None
-
20w20b, 20w21a
-
None
-
Confirmed
-
(Unassigned)
The bug
Unlike what the trigger name suggest, you can't detect what the original block was for the item_used_on_block trigger. The location condition is evaluated after the block change was made. This makes it impossible to detect some actions.
How to reproduce
- Create the following advancement.
{ "criteria": { "place": { "trigger": "minecraft:item_used_on_block", "conditions": { "location": { "block": { "block": "minecraft:dirt" } } } } }, "rewards": { "function": "test:tilled_dirt" } }
- Create the following function
advancement revoke @s only test:tilled_dirt say used item on dirt
- Use a hoe on dirt
Notice that the advancement is not granted - This advancement will be granted correctly when placing block on dirt, because the dirt itself does not change
- This can also be verified by checking the state of button presses.
Fix
An easy way to fix this is by adding a "block" predicate to this trigger. Triggers like bee_nest_destroyed can already check the original block.
- is duplicated by
-
MC-185444 Carving a pumpkin using shears doesn't activate advancement trigger item_used_on_block
- Resolved
-
MC-248376 advancement trigger minecraft:item_used_on_block does not check the block used_on
- Resolved
-
MC-272466 "minecraft:item_used_on_block" Advancement Trigger does not register turning a block into Farmland
- Resolved