mojira.dev
MC-119047

Advancements NBT and such ignored on condition inventory_changed

The NBT, and durability tags etc are ignored in advancements when using inventory_changed

First a reference to the wiki where they give an example of inventory change
http://minecraft.gamepedia.com/Advancements

{
       "criteria": {
           "example": {
               "trigger": "minecraft:inventory_changed",
               "conditions": {
                   "items": [
                       {
                           "item": "minecraft:stone",
                           "data": 2,
                           "count": {
                               "min": 5,
                               "max": 10
                           }
                       },
                       {
                           "item": "minecraft:wool",
                           "data": 5
                       },
                       {
                           {color:red}"item": "minecraft:wooden_sword",
                           "durability": {"min": 50},
                           "nbt": "{display:{Name:\"Example\"}}"{color}
                       }
                   ],
                   "slots": {
                       "occupied": 3
                   }
               }
           }
       }
   }

So I marked the problem red. the item works fine, but if I give myzelf an sword thats called "not this one" and is almost broken (damage below 50) the game still gives me the achievements.

So I tried this:

"trigger": "minecraft:inventory_changed",
    "conditions": {
        "nbt": "{display:{Name:\"Example\"}}"
}

but this allowed all items to be used nomatter what name (also tried removing the "\" but din't effect the results)

Comments 2

Cannot reproduce in vanilla 1.12, the provided advancement works fine. Make sure you type /reload after making changes to ensure the most recent version of the file is being used. Also be aware that this bug tracker is for vanilla only, so we cannot accept bugs unless specifically reproducible in vanilla.

invalid, modded server.

Jelle Wietsma

(Unassigned)

Unconfirmed

Minecraft 1.12

Retrieved