Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-224524

Advancement minecraft:inventory_changed trigger compares same slot multiple times.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 21w17a, 1.20.6, 1.21.3
    • None
    • Confirmed
    • (Unassigned)

      The following advancement:

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

      Will trigger the advancement 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.

            Unassigned Unassigned
            Bertie2011 Bertie
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              CHK: