BradBot1 / LifeSteal

A fabric mod that implements a customisable version of the LifeSteal SMP
Apache License 2.0
2 stars 8 forks source link

shaped recipes dont work #6

Closed W1llDu closed 2 years ago

W1llDu commented 2 years ago

for example:

{
  "id": "lifesteal:health",
  "recipe": {
    "type": "minecraft:shaped_crafting",
    "group": "minecraft_apple",
    "icon": {
      "id": "minecraft:apple",
      "Count": 1,
      "tag": {
        "display": {  
          "Name": "{\"color\":\"red\",\"text\":\"Health\"}"
        },
        "Marks": [
          "lifesteal"
        ]
      }
    },
    "requirements": {
    },
    "results": {
    },
    "pattern": [
      "DTD",
      "RSR",
      "HNH"
    ],
    "key": {
      "D": {
        "item": "minecraft:diamond_block"
      },
      "T": {
        "item": "minecraft:totem_of_undying"
      },
      "R": {
        "item": "minecraft:respawn_anchor"
      },
      "S": {
        "item": "minecraft:heart_of_the_sea"
      },
      "H": {
        "item": "minecraft:dragon_head"
      },
      "N": {
        "item": "minecraft:nether_star"
      }
    }
  }
}

java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonElement.getAsJsonArray()" because the return value of "com.google.gson.JsonObject.get(String)" is null

BradBot1 commented 2 years ago

Bfapi uses a different recipe stuff to make it easier to make them without a tool, for a shaped recipe you would need to do:

{
  "id": "lifesteal:health",
  "recipe": {
    "type": "minecraft:shaped_crafting",
    "group": "minecraft_apple",
    "icon": {
      "id": "minecraft:apple",
      "Count": 1,
      "tag": {
        "Marks": [
          "lifesteal"
        ],
        "display": {
          "Name": "{\"color\":\"red\",\"text\":\"Health\"}"
        }
      }
    },
    "requirements": {
    },
    "results": {
    },
    "ingredients": [
      "minecraft:diamond_block", "minecraft:totem_of_undying", "minecraft:diamond_block",
      "minecraft:respawn_anchor", "minecraft:heart_of_the_sea", "minecraft:respawn_anchor",
      "minecraft:dragon_head", "minecraft:nether_star", "minecraft:dragon_head"
    ],
    "size": "3x3"
  }
}

image

Hope this helps <3