Skip to main content

Crafting Recipe (Data Type)

An Object that describes a shapeless or shaped crafting recipe.

Fields (both types)

FieldTypeDefaultDescription
typeIdentifierrequiredThe type of recipe, either minecraft:crafting_shaped or minecraft:crafting_shapeless. Other recipe types aren't supported.
idIdentifierrequiredAn ID for this recipe. In apoli:recipe it is optional (the power's ID is used instead), and several powers can share one, see Sharing an id. A power's recipe replaces a data pack recipe with the same ID.
resultObjectrequiredThe crafted item: id (the item), an optional count (default 1) and optional components. On 1.20.1 the item is written as item instead of id, and the result can't carry NBT.

Fields (shapeless)

FieldTypeDefaultDescription
ingredientsArray of IngredientrequiredThe items that go in the crafting grid for the recipe.

Examples (shapeless)

"recipe": {
	"type": "minecraft:crafting_shapeless",
	"id": "apoli:fire_charge_without_blaze_powder",
	"ingredients": [
	    {
	      	"item": "minecraft:gunpowder"
	    },
	    [
		    {
		        "item": "minecraft:coal"
		    },
		    {
		        "item": "minecraft:charcoal"
		    }
	    ]
	],
	"result": {
	    "id": "minecraft:fire_charge",
	    "count": 3
	}
}

A recipe for fire charges that doesn't need the blaze powder of the vanilla recipe.

Fields (shaped)

FieldTypeDefaultDescription
patternArray of StringsrequiredThe pattern, with each element as one row. Use one character for each item, and a space for an empty position.
keyObject of "character": Ingredient fieldsrequiredWhich Ingredient each character in the pattern stands for.

Examples (shaped)

"recipe": {
	"type": "minecraft:crafting_shaped",
	"id": "apoli:sideways_birch_boat",
	"pattern": [
	    "##",
	    " #",
	    "##"
	],
	"key": {
	    "#": {
	    	"item": "minecraft:birch_planks"
	    }
  	},
  	"result": {
    	"id": "minecraft:birch_boat"
  	}
}

A recipe for a birch boat, with the planks turned sideways in the crafting grid.