top of page

How to make Custom Crafting Recipes (1.19+)

Updated: Apr 28, 2023

Heads up! This tutorial requires a Data Pack to work.

If you don't have one (or don't know how to make one), you can use this file.





Don't know how to edit data files? See: How to edit Data Files for Minecraft

You may want to read this post if you don't know what JSON terms are!

A Crafting Recipe is what players use to craft items. "Shaped" means that the ingredients must be placed in specific slots to craft the item, like a wooden pickaxe for example.

"Shapeless" means the items required can be anywhere in the table, like crafting some planks from logs.


For this tutorial, we'll be making one Shaped Stone Sword recipe using Stone instead of Cobblestone, and one Shapeless Fire Charge recipe using 2 Sticks.


Shaped Stone Sword Recipe

First, create a new text document in the "recipes" folder (or open the one named "Test" in that zip file).


Next, add a new "type" Key/Value.

This recipe is Shaped, so set the Value to "minecraft:crafting_shaped".

{
    "type": "minecraft:crafting_shaped"
}

Next, we'll need to create our "pattern" Key/Value.

The pattern we create will determine how the recipe in-game is crafted.

Since the pattern will need to use multiple symbols as its Value, we'll set the Value to an Array. Don't forget to add a comma after every Key/Value, so Minecraft reads the whole file.

{
    "type": "minecraft:crafting_shaped",
    "pattern": []
}

The way the pattern works is by taking 3 different Values (separated by commas), and using that as our grid. Depending on the shape of your recipe, you may not need all 3 Values.

Here's a visualized version of what I mean:

ree

Before we build our recipe's shape, we need to specify what we'll be using to identify each symbol in the pattern--in other words, we need our key.


The "key" has an Object as its Value, and that's because each symbol we list in the key is an Object.

{
    "type": "minecraft:crafting_shaped",
    "pattern": [],
    "key": {}
}

Now, we need to specify the symbol we want to use.

You can write any character on your keyboard and use that as a key, EXCEPT for spaces.


Spaces in the pattern are specifically used to show an air block in the recipe, so no ingredients can be placed in that square.


To keep things really simple, let's just use the first letter of each ingredient we use.

The symbols are Case Sensitive, so you can use the same one for 2 keys if one is uppercase and the other is lowercase.

We'll use 2 different symbols for this tutorial, though.


For a Stone Sword, we'll use "S" to define Stone, and "T" to define "Sticks".

Each key we define is an Object, with an "item" Key. The Value is the item it represents.

{
    "type": "minecraft:crafting_shaped",
    "pattern": [],
    "key": {
        "S": {"item": "minecraft:stone"},
        "T": {"item": "minecraft:stick"}
    }
}

Now that we have our keys defined, we can build the recipe. I'll open up the "pattern" area so we can display the recipe easier.


Remember, the pattern reads the Array from left to right, with the leftmost Value being the top row of the grid.

And again, any spaces in the pattern will be read as an air block. Our tutorial recipe doesn't require air blocks in the recipe, so we won't add any.

{
    "type": "minecraft:crafting_shaped",
    "pattern": [
        "S",
        "S",
        "T"
    ],
    "key": {
        "S": {"item": "minecraft:stone"},
        "T": {"item": "minecraft:stick"}
    }
}

Here's a compacted version of the pattern, so you can understand better:

"pattern": ["S","S","T"],

The next part we need to add is the result of the crafting recipe.

This part's really simple, it's just a "result" Key with an Object as its Value.

{
    "type": "minecraft:crafting_shaped",
    "pattern": [
        "S",
        "S",
        "T"
    ],
    "key": {
        "S": {"item": "minecraft:stone"},
        "T": {"item": "minecraft:stick"}
    },
    "result": {}
}

This result has 2 Key/Values inside: one for the item that's being crafted ("item"), and one for how many of this item we get per recipe ("count").


For reference, the recipe for making Sticks has a "count" of 4, since you get 4 sticks per recipe.

{
    "type": "minecraft:crafting_shaped",
    "pattern": [
        "S",
        "S",
        "T"
    ],
    "key": {
        "S": {"item": "minecraft:stone"},
        "T": {"item": "minecraft:stick"}
    },
    "result": {
        "item": "minecraft:stone_sword",
        "count": 1
    }
}

And we're done! It's very simple.

Here's what the finished product would look like in-game:

ree

Now, let's say you wanted this recipe to be a 2x2, so you wouldn't need a crafting table to make it.


That's very easy to do. Just put 2 of your keys in the first Array Value, and 1 of them in the second:

{
    "type": "minecraft:crafting_shaped",
    "pattern": [
        "ST",
        "S"
    ],
    "key": {
        "S": {"item": "minecraft:stone"},
        "T": {"item": "minecraft:stick"}
    },
    "result": {
        "item": "minecraft:stone_sword",
        "count": 1
    }
}

It would come out like this.

ree

Shapeless Fire Charge Recipe

A Shapeless recipe is very similar in structure to a Shaped recipe.

The difference is that we omit the pattern area entirely, change the "type" of the recipe, and replace "key" with "ingredients".

You can add a max of 9 ingredients, since there are only 9 different spaces in a crafting table.


"ingredients" is an Array, because each ingredient we add to the recipe is a Key/Value.

{
  "type": "minecraft:crafting_shapeless",
  "ingredients": [],
  "result": {
    "item": "",
    "count":
  }
}

To make our Fire Charge recipe, we want to be able to use 2 sticks to quickly make 1 Fire Charge.


So, we'll add 2 Key/Value Objects for sticks. No need to define a symbol for a key.

{
  "type": "minecraft:crafting_shapeless",
  "ingredients": [
    {
      "item": "minecraft:stick"
    },
    {
      "item": "minecraft:stick"
    }
  ],
  "result": {
    "item": "",
    "count":
  }
}

Then, the result and count.

{
  "type": "minecraft:crafting_shapeless",
  "ingredients": [
    {
      "item": "minecraft:stick"
    },
    {
      "item": "minecraft:stick"
    }
  ],
  "result": {
    "item": "minecraft:fire_charge",
    "count": 1
  }
}

And now, that's done too!


The last step is for us to use it in-game.


To do this, save the file and give it a name.


The name can just be the name of the resulting item, as long as it has no spaces.

Let's call it "stone_sword".

Make sure it's a .json file by changing the extension of it to .json, so it looks like "stone_sword.json".

ree

All done! That's all you need to make your own custom crafting recipes.


For instructions on importing these recipes into your data packs, visit How to install data packs in Minecraft.


If you have anything else you want to ask, feel free to leave a comment!

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating

Created by Professional Loser, 2023. This site is unaffiliated with Minecraft™ or Mojang.

bottom of page