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

NBT Tags being ignored in Custom Recipes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • None
    • Minecraft 17w48a
    • None
    • Mac OS High Sierra (10.12), Java 8
    • Unconfirmed

      The most recent snapshot (17w48a) added the ability for datapacks to include custom recipes.

      Recipes with NBT tags (for example, a named or enchanted item) should work. In-game crafting, however, ignores the nbt tag and crafts as if it were not specified.

      As a test, I tried two ways of doing the NBT tags for the resulting item, which should be (as an example) a diamond chestplate with Protection I.

      1: As its own string, i.e.

      "result": {
          "item": "minecraft:diamond_chestplate",
          "nbt": "{ench:[{id:0,lvl:1}]}",
          "count": 1
      }
      

      This results in a diamond chestplate which is not enchanted, seen below in the screenshot with the emerald. No errors are returned in the output log here.

      2: With the item string (as the newer syntax for item nbt), i.e.

      "result": {
          "item": "minecraft:diamond_chestplate{ench:[{id:0,lvl:1}]}",
          "count": 1
      }
      

      This crafting recipe has no result at all, seen below in the screenshot with the nether star.
      The output log returns the result:

      java.lang.IllegalArgumentException: Non [a-z0-9/._-] character in path of location: minecraft:diamond_chestplate{ench:[{id:0,lvl:1}]}
      

      referring to the NBT tag itself.

      In case it helps, I've also attached a zipped version of the datapack I'm using.

        1. Recipe with NBT in Item String.png
          46 kB
          Withered Away
        2. Recipe with NBT String.png
          69 kB
          Withered Away

            Unassigned Unassigned
            Zephyranemos Withered Away
            Votes:
            0 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved: