Custom recipes: shaped, shapeless, and using tags instead of listing every wood
A shaped recipe that will not craft usually has its key wrong or its pattern padded. Here is the JSON, the tag trick that collapses eight 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. A 2×2 recipe should be written as two rows of
two, not padded into a 3×3 with spaces. Padding makes it only craftable in that exact corner of the grid.
- 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 eight recipes for eight 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 chat on reload — malformed JSON is reported there.
/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.