The bug
When using an items
condition in the inventory_changed
advancement trigger to detect for a specific item in the inventory, the advancement does not work anymore if the player has that item beforehand and then obtains or consumes a different item. This is not the case in 1.15.2 and older versions.
How to reproduce
Install the data pack below in a world for easier reproduction.
Obtain a Crafting Table.
→ ✔ A ding sound event plays.Update the inventory keeping the Crafting Table intact.
→ ❌ The ding sound event does not play even if the inventory changes and preserves the Crafting Table.
Attachments
Comments 4
Here is an example advancement:
{
"criteria": {
"crafting_table": {
"trigger": "inventory_changed",
"conditions": {
"items": [
{
"item": "crafting_table"
}
]
}
}
},
"rewards": {
"function": "game:root"
}
}
# root.mcfunction
tellraw @a ["",{"selector":"@s"}," has a Crafting Table"]
advancement revoke @s only game:root
Obtain a Crafting Table, and a message is shown in chat. Obtain another item, and the message is not shown in chat although you have the Crafting Table intact. This does not happen in older versions.
The bug should be assigned to the Data Packs category.