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

Advancement conditions with nbt data do not work correctly for inventory_changed

XMLWordPrintable

    • Confirmed

      I have created a file at <world_save>/data/advancements/zed/challenges/root.json with the following contents:

      {
          "display": {
              "icon": {
                  "item": "minecraft:redstone_block"
              },
              "title": "Zedcraft",
              "background": "minecraft:textures/gui/advancements/backgrounds/nether.png",
              "description": "Custom goals and challenges for Zedcraft"
          },
          "criteria": {
              "create_zedcraft_advancement_book": {
                  "trigger": "minecraft:inventory_changed",
                  "conditions": {
                      "items": [
                          {
                              "item": "minecraft:book",
                              "nbt": "{display:{Name:\"Zedcraft challenges\"}}"
                          }
                      ]
                  }
              }
          }
      }    
      

      I am unable to get the advancement to trigger using either a Book named Zedcraft challenges in an anvil or by using the following give command:

      /give @s minecraft:book 1 0 {display:{Name:"Zedcraft challenges"}}
      

      However if I remove the NBT condition it works correctly for any book, and I know that Minecraft is recognising the NBT string as if I make the syntax invalid in the JSON file, I get an exception in the logs. I tried it with written_ book as well with a 'title' condition as well as with various different title/name strings. This could be true for other NBT related conditions/triggers as well, but I have only tested it on inventory_changed.

            dinnerbone [Mojang] Nathan Adams
            drhenchman DrHenchman
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: