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
tutorial:recipes [2025/04/01 08:18] – [More on the recipe type] update link solidblocktutorial:recipes [2026/03/01 23:38] (current) – Multiversion recipe examples cassiancc
Line 8: Line 8:
 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). 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 (remember the path is //"recipes"// before 1.21 and //"recipe"// since 1.21and in the ''%%"result"%%'' fieldreplace ''%%"id"%%'' with ''%%"item"%%'' for versions before 1.21):+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> <code javascript resources/data/tutorial/recipe/custom_item.json>
Line 32: Line 59:
 } }
 </code> </code>
 +
 +===== 1.20 through 1.20.6 =====
 +
 +Recipes are stored in ''data/<namespace>/recipes''.
 +
 +<code javascript resources/data/tutorial/recipes/custom_item.json>
 +{
 +  "type": "minecraft:crafting_shaped",
 +  "pattern": [
 +    "WWW",
 +    "WR ",
 +    "WWW"
 +  ],
 +  "key": {
 +    "W": {
 +      "tag": "minecraft:logs"
 +    },
 +    "R": {
 +      "item": "minecraft:redstone"
 +    }
 +  },
 +  "result": {
 +    "item": "tutorial:custom_item",
 +    "count": 4
 +  }
 +}
 +</code>
 +
 +
 Breakdown of the recipe:   Breakdown of the recipe:  
   *  **type**: This is a shaped crafting recipe.    *  **type**: This is a shaped crafting recipe. 
tutorial/recipes.txt · Last modified: 2026/03/01 23:38 by cassiancc