Custom recipes: shaped, shapeless, and using tags instead of listing every wood
A shaped recipe that will not craft usually has its key wrong. Here is the JSON, what the game trims from a pattern for you, the tag trick that collapses thirteen recipes into one, and how to test.
Recipes are among the easiest datapack files to write and among the easiest to get subtly wrong, because a broken one fails silently — the crafting grid simply does nothing.
Shaped
{
"type": "minecraft:crafting_shaped",
"pattern": [ "SSS", "S S", "SSS" ],
"key": { "S": "minecraft:stone" },
"result": { "id": "minecraft:furnace", "count": 1 }
}
Three rules that cause most failures:
- Every character in
patternmust exist inkey, except a space, which means empty. - The pattern is relative, not absolute. The game trims blank rows and columns off the edges, so a 2×2 padded into a 3×3 with spaces still crafts anywhere in the grid — but writing it as two rows of two is clearer.
- Rows must all be the same length.
["SS", "S"]is invalid.
Shapeless
{
"type": "minecraft:crafting_shapeless",
"ingredients": ["minecraft:stone", "minecraft:coal"],
"result": { "id": "minecraft:torch", "count": 4 }
}
Order is irrelevant. Duplicates must be listed once each — two coal means two entries.
Tags collapse a family into one recipe
Instead of thirteen recipes for thirteen plank types:
"key": { "P": "#minecraft:planks" }
The # marks an item tag. #minecraft:planks, #minecraft:logs, #minecraft:wool, #minecraft:stone_crafting_materials and dozens more already exist. Defining your own takes one file:
data/<namespace>/tags/item/my_metals.json
{ "values": ["minecraft:iron_ingot", "minecraft:gold_ingot"] }
Note tags/item/ — singular item, plural tags. That inconsistency is real.
Result with components
"result": {
"id": "minecraft:diamond_sword",
"count": 1,
"components": { "minecraft:custom_name": "Excalibur", "minecraft:enchantments": { "sharpness": 5 } }
}
This is how a custom item becomes craftable without a mod.
The other recipe types
crafting_shaped and crafting_shapeless are two of many. Also available: smelting, blasting, smoking, campfire_cooking, stonecutting, smithing_transform and smithing_trim. The cooking types take cookingtime and experience; stonecutting takes a single ingredient and a count.
Testing
/reload then try the grid. If nothing happens:
- Check the game log (
latest.log) after/reload— malformed JSON is reported there, not in chat. /recipe give @s <namespace>:<recipe>— if the recipe id is wrong, this errors, which tells you the file is not being read at all.- Recipe unlocking is separate from recipe existing. A recipe works in the grid even if it never appears in the recipe book.
Build recipe, predicate and kit JSON with the keys and tags checked in the Datapack JSON Builders.