mojira.dev
MC-224524

Advancement minecraft:inventory_changed trigger compares same slot multiple times.

The following advancement:

{
    "criteria": {
        "test": {
            "trigger": "minecraft:inventory_changed",
            "conditions": {
                "items": [
                    {
                        "items": "minecraft:iron_nugget",
                        "count": 64
                    },
                    {
                        "items": "minecraft:iron_nugget",
                        "count": {
                            "min": 36
                        }
                    }
                ]
            }
        }
    }
}

Will trigger with only 64 iron ingots in the inventory (as it matches both specified items). I expected that it would only trigger when there are two slots filled with iron nuggets, one with 64 and one with at least 36.

There was another issue about the counts not going cross-slot which was marked as "works as intended", but if the item declarations also check slots multiple times it becomes difficult if not impossible to check for more than one stack amount of the item with advancements.

Linked issues

Comments 1

Bertie

(Unassigned)

Confirmed

Advancements

21w17a, 1.20.6, 1.21.3

Retrieved