Skip to content

Server resources

Crystal Spider edited this page Dec 20, 2024 · 9 revisions

General info

It goes without saying that a player should be able to obtain your added leathered boots somehow.
That's where crafting recipes come into play!
In this page you will find anything you need to know to add leathered boots crafting/smithing recipes.
Feel free to skip if you don't want classic crafting/smithing recipes for your leathered boots.

Every time below you see the string custom_armor_material, it must be replaced with the value returned by your custom ArmorMaterial ArmorMaterial#getName() method.

Recipes

Since 1.21.3

Same as for 1.21, but the JSON structure has to change:

{
  "type": "minecraft:smithing_transform",
  "addition": "minecraft:leather",
  "base": "mod_id:custom_boots",
  "result": {
    "count": 1,
    "id": "mod_id:leathered_custom_armor_material_boots"
  },
  "template": "leathered_boots:leather_upgrade_smithing_template"
}

As before, the files must go under resources/data/mod_id/recipe/smithing/.

Since 1.21

Same as for 1.20, but the JSON structure changes a bit:

{
  "type": "minecraft:smithing_transform",
  "addition": {
    "item": "minecraft:leather"
  },
  "base": {
    "item": "mod_id:custom_boots"
  },
  "result": {
    // The two lines below are changed since 1.21
    "count": 1,
    "id": "mod_id:leathered_custom_armor_material_boots"
  },
  "template": {
    "item": "leathered_boots:leather_upgrade_smithing_template"
  }
}

And the files must go under resources/data/mod_id/recipe/smithing/.

Since 1.20

From 1.20 onwards, leathered boots can be crafted only via smithing with the leather upgrade smithing template.
Under resources/data/mod_id/recipes/smithing/ add a leathered_custom_armor_material_boots.json file with the following content:

{
  "type": "minecraft:smithing_transform",
  "addition": {
    "item": "minecraft:leather"
  },
  "base": {
    "item": "mod_id:custom_boots"
  },
  "result": {
    "item": "mod_id:leathered_custom_armor_material_boots"
  },
  "template": {
    "item": "leathered_boots:leather_upgrade_smithing_template"
  }
}

Before 1.20

  • Crafting recipes
    Crafting recipes are the classic and basic way to obtain the leathered version of your custom boots.
    Under resources/data/mod_id/recipes/crafting/ add a leathered_custom_armor_material_boots.json file with the following content:
    {
      "type": "minecraft:crafting_shapeless",
      "category": "equipment",
      "group": "leathered_boots", // Add this only if you do not plan on changing the ingredients below
      "ingredients": [
        {
          "item": "mod_id:custom_boots"
        },
        {
          "item": "minecraft:leather_boots"
        }
      ],
      "result": {
        "item": "mod_id:leathered_custom_armor_material_boots"
      }
    }
  • Smithing recipes
    Smithing recipes are useful when adding your mod in an already existing world, as they allow a player to not lose the enchantments on their boots if they decide to upgrade them to their leathered version.
    Under resources/data/mod_id/recipes/smithing/ add a leathered_custom_armor_material_boots.json file with the following content:
    {
      "type": "minecraft:smithing",
      "addition": {
        "item": "minecraft:leather_boots"
      },
      "base": {
        "item": "mod_id:custom_boots"
      },
      "result": {
        "item": "mod_id:leathered_custom_armor_material_boots"
      }
    }

Recipe book

Since Minecraft 1.12, a recipe book has been added.
This is usually not very used in modded environments, but if you want to keep Vanilla style too you can add recipe book advancement to unlock the previously created crafting recipes.
If you followed thoroughly the previous section for the creation of recipes, you can simply copy-paste the following JSON snippet into a file named leathered_custom_armor_material_boots.json under resources/data/mod_id/advancements/recipes/ and only replace the placeholder values.
If instead you tweaked the crafting recipes, you will have to tweak the content of this snippet too, although the name and location of the file should remain unchanged.

Since 1.21

The file location is now under resources/data/mod_id/advancement/recipes/, but everything else is the same as for 1.20.

Since 1.20

{
  "parent": "minecraft:recipes/root",
  "criteria": {
    "has_leather": {
      "conditions": {
        "items": [
          {
            "items": [
              "minecraft:leather"
            ]
          }
        ]
      },
      "trigger": "minecraft:inventory_changed"
    },
    "has_the_recipe": {
      "conditions": {
        "recipe": "mod_id:smithing/leathered_custom_armor_material_boots"
      },
      "trigger": "minecraft:recipe_unlocked"
    }
  },
  "requirements": [
    [
      "has_the_recipe",
      "has_leather"
    ]
  ],
  "rewards": {
    "recipes": [
      "mod_id:smithing/leathered_custom_armor_material_boots"
    ]
  }
}

Before 1.20

{
  "parent": "minecraft:recipes/root",
  "criteria": {
    "has_leather_boots": {
      "conditions": {
        "items": [
          {
            "items": [
              "minecraft:leather_boots"
            ]
          }
        ]
      },
      "trigger": "minecraft:inventory_changed"
    },
    "has_the_recipe": {
      "conditions": {
        "recipe": "mod_id:leathered_custom_armor_material_boots"
      },
      "trigger": "minecraft:recipe_unlocked"
    }
  },
  "requirements": [
    [
      "has_leather_boots",
      "has_the_recipe"
    ]
  ],
  "rewards": {
    "recipes": [
      "mod_id:crafting/leathered_custom_armor_material_boots",
      "mod_id:smithing/leathered_custom_armor_material_boots"
    ]
  }
}