====== クラフトレシピ ====== ===== 基本的なクラフトレシピの追加 ===== このチュートリアルを読む前に、 [[tutorial:items|追加されたアイテム]] を確認してください。 これまでのところ、アイテムはクリエイティブメニューまたはコマンドから取得できます。 サバイバルプレイヤーが利用できるようにするために、アイテムの作成レシピを追加します。 ''resources/data/tutorial/recipes/'' の下に ''custom_item.json'' という名前のファイルを作成します(必要に応じてチュートリアルを自分の Mod ID に置き換えてください)。\\ レシピ ファイルは通常、出力後に名前が付けられますが、任意の名前を付けることができます。 作成した ''custom_item'' のレシピの例を次に示します: { "type": "minecraft:crafting_shaped", "pattern": [ "WWW", "WR ", "WWW" ], "key": { "W": { "tag": "minecraft:logs" }, "R": { "item": "minecraft:redstone" } }, "result": { "item": "tutorial:custom_item", "count": 4 } } レシピの内訳: * **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. * **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]] 全体として、クラフトレシピは次のようになります: ^ Recipe for 4 custom_item ^^^ |任意の原木|任意の原木|任意の原木| |任意の原木|レッドストーン|なし| |任意の原木|任意の原木|任意の原木| 基本的なレシピのフォーマットの詳細については、[[https://minecraft.gamepedia.com/Recipe|こちら]] を参照してください。 レシピは実行時に動的に生成することもできます。詳細については、[[tutorial:dynamic_recipe_generation|こちら]] を参照してください。 ===== レシピタイプの詳細 ===== ''type'' の値は変更できるため、対応するクラフトブロック(ストーン カッター、溶鉱炉、鍛冶台など)で使用できます。[[https://minecraft.gamepedia.com/Recipe#List_of_recipe_types|こちら]] からすべてのタイプと値を参照してください。 独自のレシピタイプを作成することもできます:[[tutorial:recipe_types_introduction|RecipeTypes の紹介]]