consume_item trigger runs reward function before replacing the item
The bug
I expected to be able to replace the player's mainhand when the consume_item trigger runs. Instead the item gets replaced by what would've been the resulting item after consuming.
How to reproduce
- Have an advancement that runs a function every time the player consumes an item
{ "criteria": { "requirement": { "trigger": "minecraft:consume_item" } }, "rewards": { "function": "test:consume_item" } } - Create a function that replaces the mainhand with an apple
advancement revoke @s only test:consume_item replaceitem entity @s weapon.mainhand apple
- Take a stack of bread and eat it in survival
You briefly see the item, but then it gets replaced by 63 bread
2020-05-17, 01:30 PM
2020-12-28, 12:55 AM
2020-12-28, 12:55 AM
1
3
1.15.2, 20w20b, 20w22a, 1.16 Pre-release 3
-