Fabric Modding: Introduction to Crafting Recipes

This post was written for Minecraft Java 1.21.6 and Fabric Loader 0.16.14.

Once you have custom items and blocks showing up in the creative menu, the next step is making them usable in survival mode. That means crafting recipes!

Minecraft uses simple .json files to define how items and blocks are crafted. These files go in a specific folder structure in your mod project and follow a well-documented format that the game reads during loading. In this tutorial, we’ll walk through how to create shaped, shapeless, and reverse crafting recipes for your modded content.

Previously, we went over the very basics of models, textures, language files, and creative tabs.

Where Recipe Files Go

Crafting recipes are data-driven, so they live in the data/ folder in your mod’s resources. For example, the recipe for our bubble_gum item would be placed at:

src/main/resources/data/strawberry/recipe/bubble_gum.json

Each recipe must be in the data/yourmodid/recipe/ directory, and each file ought be named to match the resulting item (or however you choose to organize it).

Shapeless Crafting: Bubble Gum

Let’s start with a shapeless recipe—one where the arrangement of ingredients doesn’t matter.

File: bubble_gum.json

{
  "type": "minecraft:crafting_shapeless",
  "ingredients": [
    "minecraft:sweet_berries",
    "minecraft:resin_clump",
    "minecraft:sugar",
    "minecraft:pink_dye"
  ],
  "result": {
    "id": "strawberry:bubble_gum",
    "count": 4
  }
}

Explanation:

  • type: This defines the recipe as shapeless.
  • ingredients: A list of the required items, no particular order needed.
  • result: The item to craft and how many.

Shapeless recipes are great for simple combinations or small utility recipes where placement shouldn’t matter.

In-game screenshot showing the crafting recipe for bubble gum.

Shaped Crafting: Bubble Gum Block

Now we’ll define a shaped recipe where the layout in the crafting grid matters. In this case, we’ll make a full block of bubble gum from 9 pieces of the item.

File: bubble_gum_block.json

{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "###",
    "###",
    "###"
  ],
  "key": {
    "#": "strawberry:bubble_gum"
  },
  "result": {
    "id": "strawberry:bubble_gum_block",
    "count": 1
  }
}

Explanation:

  • pattern: Defines the layout using symbolic characters.
  • key: Maps each symbol to an item.
  • result: Specifies what to craft.

Shaped recipes can be as small as 2×1 or 2×2—just like vanilla recipes such as torches or sticks. Minecraft will automatically trim empty rows and columns, so your pattern can be compact and still valid. Just make sure the layout matches how players will place items in the grid. Even if you only use a few items, the pattern must match the exact shape in-game. If your shaped recipe can be as small as 1×1, it’s probably better to make it a shapeless recipe!

Crafting recipe for the block of bubble gum.

Reverse Crafting: Unpacking Bubble Gum

Let’s also add a reverse recipe to break the block back into items. A reverse recipe isn’t any kind of special recipe type, it’s just a name we might use to un-craft a blocked item into its component parts!

File: bubble_gum_from_bubble_gum_block.json

{
  "type": "minecraft:crafting_shapeless",
  "ingredients": [
    "strawberry:bubble_gum_block"
  ],
  "result": {
    "id": "strawberry:bubble_gum",
    "count": 9
  }
}

This is another shapeless recipe, meaning you just need one bubble_gum_block anywhere in the grid to get nine individual bubble gums.

Crafting the bubble gum block back into 9 bubblegum

2×2 vs 3×3 Crafting

By default, all recipes are designed for the 3×3 crafting grid (like the one in a crafting table). If you want your recipe to be craftable in the 2×2 player inventory grid, make sure:

  • Your pattern is 2×2 or smaller.
  • You do not use more than four unique ingredient spots.

For example, a compact 2×2 pattern:

  "pattern": [
    "##",
    "##"
  ],

However, recipes that require 3×3 grids won’t be available in the player’s inventory crafting—only at a crafting table.

Use the Recipe Generator

Instead of writing recipe JSON files from scratch, check out crafting.thedestruc7i0n.ca. It’s a visual recipe editor that lets you:

  • Choose between shaped, shapeless, and several other recipe types
  • Set item IDs, stack counts, and recipe patterns
  • Instantly preview your result and export valid JSON

While it’s labeled for Minecraft 1.21.4, it works perfectly with 1.21.6. It includes a built-in dictionary of vanilla items, but if you’re working with modded content, just use the tool to lay out the shape and structure—then replace the item IDs with your own.

The generator also supports a number of cooking and smelting type recipes. This gives you a great starting point for exploring more advanced recipes involving furnaces, smokers, and campfires. However, there are a few recipe types are not yet supported in the generator and will be covered in a future tutorial due to their unique structure. For an idea of what I mean, here is a list of more advance recipe types:

  • crafting_transmute – crafting recipes that change one item into another while preserving its underlying data,like the dye color of a Shulker Box. It’s a type of crafting where the input item’s data (like color, NBT data) is carried over to the output item. This often involves a reagent that triggers the transmutation.
  • crafting_special_* – crafting recipes handled using built-in logic, and not displayed in the recipe book. Only useful for disabling/enabling certain recipes
  • crafting_decorated_pot – the recipe for crafting decorated pots. Also handled with built-in logic, but does show up in the recipe book
  • smithing_transform – represents a upgrading recipe in a smithing table.
  • smithing_trim – represents a trimming recipe in a smithing table.

If you’re curious how vanilla Minecraft handles these recipes, you can explore the built-in data packs by opening the game JAR file. On the official Minecraft client, this can be found at:

%appdata%\Roaming\.minecraft\versions\1.21.6\1.21.6.jar

Open it like a ZIP file, and navigate to:

data/minecraft/recipes/

Inside, you’ll find hundreds of JSON examples showing how every crafting type is implemented—from simple planks to complex smithing upgrades. Studying these files is a great way to deepen your understanding of how crafting works behind the scenes.

What’s Next?

Now that you’ve mastered the basics of crafting recipes, your items and blocks are ready to be crafted and used in survival mode. But what happens when a player breaks your custom block?

In the next tutorial, we’ll cover loot tables—the system that controls what items drop when blocks are broken or entities are defeated. You’ll learn how to make your blocks drop themselves, drop custom items, or even behave like chests with randomized loot.

See you there!

No Comments on Fabric Modding: Introduction to Crafting Recipes

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.