User Tools

Site Tools


zh_cn:tutorial:recipes

Differences

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

Link to this comparison view

Next revision
Previous revision
zh_cn:tutorial:recipes [2019/12/18 11:37] – created lightcolourzh_cn:tutorial:recipes [2022/12/16 00:25] (current) solidblock
Line 1: Line 1:
-====== Crafting recipes ====== +====== 合成配方 ====== 
-===== Adding a basic crafting recipe ===== +===== 添加基本的合成配方 ===== 
-Make sure you [[tutorial:items|added an item]] before reading this tutorial, we will be using it.   +阅读本教程之前,请确保[[zh_cn:tutorial:items|添加了物品]],我们等下会要用到。
-   +
-So far, our item is obtainable through the creative menu or commands. +
-To make it available to survival players, we'll add a crafting recipe for the item.  +
  
-Create a file named ''fabric_item.json'' under ''resources/data/tutorial/recipes/'' (replace tutorial with your mod id if appropriate).  +到目前为止,我们的物品可以通过创造模式菜单或者命令获得。要让它能够在生存模式获得到,我们需要为物品添加合成配方。 
-Here's an example recipe for the ''fabric_item'' we made: + 
-<code javascript resources/data/tutorial/recipes/fabric_item.json>+''resources/data/tutorial/recipes/''下创建一个名为''custom_item.json''的文件(若合适,请将 tutorial 替换为你的模组 id)。这是我们制作的''custom_item''的示例配方: 
 +<code javascript resources/data/tutorial/recipes/custom_item.json>
 { {
   "type": "minecraft:crafting_shaped",   "type": "minecraft:crafting_shaped",
Line 25: Line 23:
   },   },
   "result": {   "result": {
-    "item": "tutorial:fabric_item",+    "item": "tutorial:custom_item",
     "count": 4     "count": 4
   }   }
 } }
 </code> </code>
-Breakdown of the recipe:   +配方内容解析: 
-  *  **type**: This is a shaped crafting recipe.  +  *  **type**:这是个有序合成配方。 
-  *  **result**: This is a crafting recipe for 4 ''tutorial:fabric_item''. The ''count'' field is optional. If you don't specify a ''count'', it will default to 1. +  *  **result**:这是合成4个 ''tutorial:custom_item'' 的配方。''count'' 字段是可选的,如果不指定 ''count'',则默认为 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**:代表合成配方的图案。每个字母代表一个物品。空格表示该槽位没有物品。每个字母代表的物品在 **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**:每个字母代表的物品。''W'' 代表带有 ''minecraft:logs'' 标签的物品(即所有原木)。''R'' 代表红石。关于标签的更多信息,请参考 [[https://minecraft.fandom.com/zh/wiki/标签|此处]] 
-In total, the crafting recipe would look like this: +  * **category**:这个配方在解锁后在配方书中显示的分类。 
-^           Recipe for fabric_item           ^^^ +总之,该合成配方应该是这样的: 
-|Any Log|Any Log|Any Log+^           个 custom_item 的合成配方           ^^^ 
-|Any Log|Redstone|Nothing+|任何原木|任何原木|任何原木
-|Any Log|Any Log|Any Log+|任何原木|红石|空白
-For more information about the format of basic recipes, see [[https://minecraft.gamepedia.com/Recipe|here]].+|任何原木|任何原木|任何原木
 +关于基本配方格式的更多信息,参考[[https://minecraft.fandom.com/zh/wiki/配方|此处]]。 
 + 
 +配方也可以在运行时动态生成,更多信息可参考[[zh_cn:tutorial:dynamic_recipe_generation|此处]]。 
 + 
 + 
 +===== 配方类型的更多信息 ===== 
 +''type'' 值可以改变,所以可以用于其对应的合成方块(切石机、高炉等),具体的所有的类型和值参考[[https://minecraft.fandom.com/zh/wiki/配方#配方类型列表|此处]]。
  
-===== Adding a custom crafting recipe ===== +创建自己的配方类型:[[zh_cn:tutorial:recipe_types_introduction|配方类型介绍]]
-The ''type'' value can be changed to support a custom recipe [more information needed].+
  
zh_cn/tutorial/recipes.1576669059.txt.gz · Last modified: 2019/12/18 11:37 by lightcolour