User Tools

Site Tools


tutorial:recipes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorial:recipes [2022/12/16 00:25] solidblocktutorial:recipes [2026/03/01 23:38] (current) – Multiversion recipe examples cassiancc
Line 6: Line 6:
 To make it available to survival players, we'll add a crafting recipe for the item.   To make it available to survival players, we'll add a crafting recipe for the item.  
  
-Create a file named ''custom_item.json'' under ''resources/data/tutorial/recipes/'' (replace tutorial with your mod id if appropriate).\\ +Create a file named ''custom_item.json'' under ''resources/data/tutorial/**recipe**/'' (since 1.21) or ''resources/data/tutorial/**recipes**/'' (below 1.21) (replace "''tutorial''" with your namespace if appropriate). 
-Recipe files are conventionally named after their output, but they can have any name. + 
-Here's an example recipe for the ''custom_item'' we made:+Recipe files are conventionally named after their output, but they can have any name. Here's an example recipe for the ''custom_item'' we made
 + 
 +===== 1.21.2 and above ===== 
 + 
 +Recipes are stored in ''data/<namespace>/recipe''
 + 
 +<code javascript resources/data/tutorial/recipe/custom_item.json> 
 +
 +  "type""minecraft:crafting_shaped", 
 +  "pattern":
 +    "WWW", 
 +    "WR ", 
 +    "WWW" 
 +  ], 
 +  "key":
 +    "W": "#minecraft:logs", 
 +    "R": "minecraft:redstone" 
 +  }, 
 +  "result":
 +    "id": "tutorial:custom_item", 
 +    "count":
 +  } 
 +
 +</code> 
 + 
 +===== 1.21 through 1.21.1 ===== 
 + 
 +Recipes are stored in ''data/<namespace>/recipe''
 + 
 +<code javascript resources/data/tutorial/recipe/custom_item.json> 
 +
 +  "type": "minecraft:crafting_shaped", 
 +  "pattern":
 +    "WWW", 
 +    "WR ", 
 +    "WWW" 
 +  ], 
 +  "key":
 +    "W":
 +      "tag": "minecraft:logs" 
 +    }, 
 +    "R":
 +      "item": "minecraft:redstone" 
 +    } 
 +  }, 
 +  "result":
 +    "id": "tutorial:custom_item", 
 +    "count":
 +  } 
 +
 +</code> 
 + 
 +===== 1.20 through 1.20.6 ===== 
 + 
 +Recipes are stored in ''data/<namespace>/recipes''
 <code javascript resources/data/tutorial/recipes/custom_item.json> <code javascript resources/data/tutorial/recipes/custom_item.json>
 { {
Line 31: Line 86:
 } }
 </code> </code>
 +
 +
 Breakdown of the recipe:   Breakdown of the recipe:  
   *  **type**: This is a shaped crafting recipe.    *  **type**: This is a shaped crafting recipe. 
   *  **result**: This is a crafting recipe for 4 ''tutorial:custom_item''. The ''count'' field is optional. If you don't specify a ''count'', it will default to 1.   *  **result**: This is a crafting recipe for 4 ''tutorial:custom_item''. The ''count'' field is optional. If you don't specify a ''count'', it will default to 1.
   *  **pattern**: A pattern that represents the crafting recipe. Each letter represents one item. An empty space means that no item is required in that slot. What each letter represents is defined in **key**.   *  **pattern**: A pattern that represents the crafting recipe. Each letter represents one item. An empty space means that no item is required in that slot. What each letter represents is defined in **key**.
-  *  **key**:  What each letter in the pattern represents. ''W'' represents any item with the ''minecraft:logs'' tag (all logs). ''R'' represent the redstone item specificly.  For more information about tags see [[https://minecraft.gamepedia.com/Tag|here]].+  *  **key**:  What each letter in the pattern represents. ''W'' represents any item with the ''minecraft:logs'' tag (all logs). ''R'' represent the redstone item specificly.  For more information about tags see [[https://minecraft.gamepedia.com/Tag|Tag page in Minecraft Wiki]].
   * **category**: The category of the item to display in the recipe book.   * **category**: The category of the item to display in the recipe book.
 +
 In total, the crafting recipe would look like this: In total, the crafting recipe would look like this:
 +
 ^           Recipe for 4 custom_item           ^^^ ^           Recipe for 4 custom_item           ^^^
 |Any Log|Any Log|Any Log| |Any Log|Any Log|Any Log|
 |Any Log|Redstone|Nothing| |Any Log|Redstone|Nothing|
 |Any Log|Any Log|Any Log| |Any Log|Any Log|Any Log|
-For more information about the format of basic recipes, see [[https://minecraft.gamepedia.com/Recipe|here]]. 
  
-Recipes can also be generated dynamically on runtime, for more information see [[tutorial:dynamic_recipe_generation|here]].+For more information about the format of basic recipes, see [[https://minecraft.gamepedia.com/Recipe|Recipe page in Minecraft Wiki]]. 
 + 
 +Recipes can also be generated dynamically on runtime, for more information see [[dynamic_recipe_generation|Dynamic recipe generation tutorial]].
  
 ===== More on the recipe type ===== ===== More on the recipe type =====
-The ''type'' value can be changed so it can be used in the corresponding crafting block (stone cutter, blast furnace, smiting table, ...), see all types and values [[https://minecraft.gamepedia.com/Recipe#List_of_recipe_types|here]].+The ''type'' value can be changed so it can be used in the corresponding crafting block (stone cutter, blast furnace, smiting table, ...), see all types and values [[https://minecraft.wiki/Recipe|Recipe page in Minecraft Wiki]].
  
-You can even create your own recipe type[[tutorial:recipe_types_introduction|Introduction to RecipeTypes]]+  * [[recipe_types_introduction|Create your own recipe type]] 
 +  * [[datagen_recipe|Generate recipes with data generator]]
  
tutorial/recipes.1671150331.txt.gz · Last modified: 2022/12/16 00:25 by solidblock