Recipe

Recipes are a way to gradually guide new players into Minecraft by assisting them with the usage of crafting, smelting, and other block and item transformations in-game.

Recipes are data driven and be configured by data packs $$ or add-ons $$. Every crafting, smelting, blasting, campfire cooking, smoking, stonecutting and smithing recipe uses this system. $$, cartography tables and brewing recipes also use this system. Cartography table and loom recipes cannot currently be controlled.

Obtaining
Recipes can be obtained in various ways. Using the recipe automatically makes the player discover it. Recipes can also be granted using the command or as a reward for completing an advancement. Vanilla survival has multiple advancements that grant recipes, which trigger when for example the player obtains an item required in the recipe.

Once a recipe has been discovered, it is added to the player's recipe book. Discovered recipes are stored in the player's NBT.

Usage
Discovered recipes can be found in the player's recipe book. However, recipes do not need to be discovered for the player to be able to use them, unless is set to.

Recipes appear only if the player is using the recipe book in a block associated to the recipe's type; for example, furnace recipes only show up when the player use the recipe book in the furnace GUI. When the player is using the recipe book in the inventory, crafting recipes appear that can fit into the player's 2×2 inventory crafting grid.

JSON format
Custom recipes in the  folder of a data pack store the recipe data for that world as separate JSON files.

A recipe with ID  would have its JSON file located at   within a data pack.

Recipe JSON files have different structures dependent on their type, but they all have a tag in its root tag.

blasting
Represents a recipe in a blast furnace.
 * The root tag.

The default cooking time is 100 ticks, or 5 seconds.

campfire_cooking
Represents a recipe in a campfire.
 * The root tag.

The default cooking time is 100 ticks, or 5 seconds, even though all vanilla campfire cooking recipes have a cook time of 600 ticks, or 30 seconds. Campfire recipes do not trigger the recipe_unlocked criteria.

crafting_shaped
Represents a shaped crafting recipe in a crafting table.

The key used in the pattern may be any single character except, the space character, which is reserved for empty slots in a recipe.

Custom NBT data tags are not allowed for the recipe's output item.
 * The root tag.
 * : A list of single-character keys used to describe a pattern for shaped crafting. Each row in the crafting grid is one string in this list containing 3 or less keys. All strings in this list need to have the same amount of keys. A space can be used to indicate an empty spot.
 * : All keys used for this shaped crafting recipe.
 * : The ingredient corresponding to this key.
 * : An item ID.
 * : An item tag.
 * : The list of ingredients corresponding to this key.
 * : An accepted ingredient.
 * : An item ID.
 * : An item tag.
 * : The output item of the recipe.
 * : Optional. The amount of the item. Falls back to 1 if the field is absent.
 * : An item ID.
 * : An item ID.

crafting_shapeless
Represents a shapeless crafting recipe in a crafting table.

The ingredients list must have at least one and at most nine entries.

Custom NBT data tags are not allowed for the recipe's output item.
 * The root tag.
 * : A list of entries for this shapeless crafting recipe. Must have 1 to 9 entries.
 * : An entry made of a single ingredient.
 * : An item ID.
 * : An item tag.
 * : An entry made of a list of acceptable ingredients.
 * : An acceptable ingredient.
 * : An item ID.
 * : An item tag.
 * : The output item of the recipe.
 * : Optional. The amount of the item. Falls back to 1 if the field is absent.
 * : An item ID.
 * : An item ID.

crafting_special_*
Represents a crafting recipe in a crafting table that is handled with builtin logic instead of being data-driven.

When the  data pack is disabled, they can be used to reenable desired builtin crafting recipes. Unlike most other recipe types, they do not have a  field and cannot be displayed in recipe books.
 * The root tag.
 * : A resource location indicating the type of serializer of the recipe.


 * The armor dyeing recipe.
 * Regular recipes cannot handle multiple dyes.
 * Regular recipes cannot handle multiple dyes.


 * The banner copying recipe.
 * Regular recipes cannot copy NBT data associated to the banner item.
 * Regular recipes cannot copy NBT data associated to the banner item.


 * The written book copying recipe.
 * Regular recipes cannot copy NBT data associated to the written book item and cannot control the generation of copies.
 * Regular recipes cannot copy NBT data associated to the written book item and cannot control the generation of copies.


 * The firework rocket recipe using firework stars.
 * Regular recipes cannot handle inputs flexibly or add NBT data from a firework star to the firework rocket.
 * Regular recipes cannot handle inputs flexibly or add NBT data from a firework star to the firework rocket.


 * The firework star crafting and its fade addition recipes.
 * Regular recipes cannot handle inputs flexibly or add NBT data to the firework star.
 * The firework star crafting and its fade addition recipes.
 * Regular recipes cannot handle inputs flexibly or add NBT data to the firework star.


 * The map copying recipe.
 * Regular recipes cannot copy NBT data associated to the map item.
 * Regular recipes cannot copy NBT data associated to the map item.


 * The map zooming recipe.
 * Regular recipes cannot update NBT data associated to the map item.
 * Regular recipes cannot update NBT data associated to the map item.


 * The item repair recipe.
 * Regular recipes cannot update damage data associated to the tool item.
 * Regular recipes cannot update damage data associated to the tool item.


 * The shield pattern application recipe.
 * Regular recipes cannot add NBT data from a banner item to a shield item.
 * Regular recipes cannot add NBT data from a banner item to a shield item.


 * The shulker box dyeing recipe.
 * Regular recipes cannot copy NBT data from a shulker box item to a dyed shulker box item.
 * Regular recipes cannot copy NBT data from a shulker box item to a dyed shulker box item.


 * The tipped arrow recipe.
 * Regular recipes cannot copy NBT data from a lingering potion item to a tipped arrow item.
 * Regular recipes cannot copy NBT data from a lingering potion item to a tipped arrow item.


 * The suspicious stew recipe.
 * Regular recipes cannot determine the status effect from the type of flower given.
 * Regular recipes cannot determine the status effect from the type of flower given.

smelting
Represents a recipe in a furnace.
 * The root tag.

The default cooking time is 200 ticks, or 10 seconds.

smithing
Represents a recipe in a smithing table. The resulting item copies the NBT tags of the base item.
 * The root tag.
 * Ingredient specifying an item to be upgraded.
 * : An item ID.
 * : An item tag.
 * : An item ID.
 * : An item tag.
 * Item specifying the resulting type of the upgraded item.
 * : An item tag.
 * Item specifying the resulting type of the upgraded item.

smoking
Represents a recipe in a smoker.
 * The root tag.

The default cooking time is 100 ticks, or 5 seconds.

stonecutting
Represents a recipe in a stonecutter.
 * The root tag.
 * : The ingredient for the recipe.
 * : An item ID.
 * : An item tag.
 * : The list of ingredients for the recipe.
 * : An accepted ingredient.
 * : An item ID.
 * : An item tag.
 * : An item ID. The output item of the recipe.
 * : The amount of the output item.
 * : The amount of the output item.

Unlike the field in shaped and shapeless crafting recipes, this  field here is required.