mojira.dev
MC-299634

/item command does not trigger "minecraft:inventory_changed" advancement trigger on some slots

On armor.body slot and saddleslots, when /item modify or /item replace commands are run, it does not cause the minecraft:inventory_changed to be triggered.

Steps to reproduce:

  1. Create the world with bug_report datapack activated(It is provided in the files section of this post.)

  2. Run this command to see the advancement is working:
    The result should be “My Inventory Changed” text be displayed on the chat.

    /item replace entity @s weapon.mainhand with minecraft:diamond_horse_armor
  3. Run this command to see if the modifier is working:
    The result should be “My Inventory Changed” text be displayed on the chat

    /item modify entity @s weapon.mainhand bug_report:modifier_set_name
  4. Run this command to see the bug with /item replace
    The result should be, the command executing with success but “My Inventory Changed” text not being put in in chat, which shows the minecraft:inventory_changed did not trigger.

    /item replace entity @s armor.body with minecraft:diamond_horse_armor
  5. Run this command to see the bug with /item modify
    The result should be, the command executing with success but “My Inventory Changed” text not being put in in chat, which shows the minecraft:inventory_changed did not trigger.

    /item modify entity @s armor.body bug_report:modifier_set_name
  6. Repeat the steps 4 and 5 with the command being modified to replace armor.body with minecraft:diamond_horse_armor with saddle with minecraft:saddle on the step 4, and armor.body with saddle on the step 5 to see the saddle slot being broken, the outputs should be the same.

These are the steps to reproduce the bug.

Environment

A newly created Vanilla 1.21.7 Minecraft World, with bug_report datapack I have created(In the files), which only has an advancement, a function and 2 item modifiers, to visualize and test the bug.

Linked issues

Attachments

Comments 1

Video recreation of it:

[media]

Efimity

(Unassigned)

Unconfirmed

(Unassigned)

1.21.7

Retrieved