mojira.dev
MC-295994

advancement trigger minecraft:inventory_changed doesn't trigger when player dropped item.

My advancement JSON file:

{
  "criteria": {
    "xclib:player/inventory_changed": {
      "trigger": "inventory_changed",
      "conditions": {
        "items": [
          {
            "predicates": {
              "custom_data": {
                "xclib:run_command": {
                  "inventory_change": {
                    "enable": true
                  }
                }
              }
            }
          }
        ]
      }
    }
  },
  "rewards": {
    "function": "xclib:player/trigger/inventory_changed"
  }
}

the rewards function file:

advancement revoke @s only xclib:player/inventory_changed

title @s[tag=debug] actionbar "背包变动"
playsound block.note_block.pling block @s ~ ~ ~ 1 2

Comments 2

Give an item with following command:

/give @s minecraft:bow[minecraft:custom_data={'xclib:run_command':{inventory_change:{enable:true,command:"say 3"}}}]

and it triggered the advancement as well as you move it in player inventory. But when you throw it out, there will be no title and sound output.

Please attach a datapack that can be used to reproduce this issue

lbj

(Unassigned)

Unconfirmed

(Unassigned)

1.21.5

Retrieved