Table of Contents

Crafting recipes

Adding a basic crafting recipe

Make sure you added an item before reading this tutorial, we will be using it.

So far, our item is obtainable through the creative menu or commands. To make it available to survival players, we'll add a crafting recipe for the item.

Create a file named custom_item.json under resources/data/tutorial/recipe/ (since 1.21) or resources/data/tutorial/recipes/ (below 1.21) (replace “tutorial” with your namespace if appropriate).

Recipe files are conventionally named after their output, but they can have any name. Here's an example recipe for the custom_item we made (remember the path is “recipes” before 1.21 and “recipe” since 1.21, and in the "result" field, replace "id" with "item" for versions before 1.21):

resources/data/tutorial/recipe/custom_item.json
{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "WWW",
    "WR ",
    "WWW"
  ],
  "key": {
    "W": {
      "tag": "minecraft:logs"
    },
    "R": {
      "item": "minecraft:redstone"
    }
  },
  "result": {
    "id": "tutorial:custom_item",
    "count": 4
  }
}

Breakdown of the recipe:

In total, the crafting recipe would look like this:

Recipe for 4 custom_item
Any LogAny LogAny Log
Any LogRedstoneNothing
Any LogAny LogAny Log

For more information about the format of basic recipes, see Recipe page in Minecraft Wiki.

Recipes can also be generated dynamically on runtime, for more information see Dynamic recipe generation tutorial.

More on the recipe type

The type value can be changed so it can be used in the corresponding crafting block (stone cutter, blast furnace, smiting table, …), see all types and values Recipe page in Minecraft Wiki.

You can even create your own recipe type: Introduction to RecipeTypes