Mojira Archive
MC-184261

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

  1. 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"
      }
    }
  2. Create a function that replaces the mainhand with an apple
    advancement revoke @s only test:consume_item
    replaceitem entity @s weapon.mainhand apple
  3. Take a stack of bread and eat it in survival
  4. You briefly see the item, but then it gets replaced by 63 bread

Cannot Reproduce

[Helper] Misode

2020-05-17, 01:30 PM

2020-12-28, 12:55 AM

2020-12-28, 12:55 AM

1

3

Unconfirmed

(Unassigned)

1.15.2, 20w20b, 20w22a, 1.16 Pre-release 3

-