Skip to content

How to make a crafting recipe in a Minecraft mod

A recipe is data: a JSON file in your mod’s data/<modid>/recipe folder (data/<modid>/recipes before 1.21, assets/<modid>/recipes on 1.12.2) that the game loads with the world. A shaped recipe has a pattern of up to three rows and a key that says which item each symbol is.

Works on Minecraft 1.20.1 to 26.3 on NeoForge; Minecraft 1.16.5 to 26.3 on Fabric; Minecraft 1.16.5 to 1.20.1 on Forge; Minecraft 1.12.2 on Forge. Each example was compiled against its loader and version before it shipped in Linen.

  1. Make a JSON file in your mod’s recipe folder named after the recipe.
  2. Set its type to minecraft:crafting_shaped.
  3. Write the pattern rows and the key for each symbol.
  4. Set the result item and count.
  5. Load a world and check the crafting table (/reload picks up changes on 1.13 and newer).

The example uses these values. Change them in the code.

Setting In the example What it does
ingredient minecraft:cobblestone The item the 2x2 pattern is made of (an item id, or #a tag).
result minecraft:mossy_cobblestone The item it makes.
count 4 How many it makes.

The example mod is examplemod in the package com.example.examplemod. Use your own mod id and package.

Fabric 1.16.5 to 26.3, NeoForge 1.20.1 to 26.3, Forge 1.16.5 to 1.20.1

Section titled “Fabric 1.16.5 to 26.3, NeoForge 1.20.1 to 26.3, Forge 1.16.5 to 1.20.1”

Uses:

  • minecraft:crafting_shaped

Uses:

  • minecraft:crafting_shaped

In 1.12.2 a recipe is a file in assets/<modid>/recipes; the ingredient and the result are written as {“item”: “modid:name”}.

Linen’s How-tos library has this page too, with the example for your own mod’s loader and Minecraft version. Hover a name in your code and Linen points to the how-tos that explain it. Both are free. Download Linen.