手册:minecraft:recipe_shaped

来自Minecraft基岩版开发Wiki
minecraft:recipe_shaped

模式
所属域
recipes
类型
有序配方
加入版本
?

有序配方(Shaped Recipe)可将合成栏中以指定顺序排列的物品合成为另外一个或多个物品。

有序配方通常允许在工作台或有3×3合成栏的其他地方使用;最终表达效果在2×2范围内的有序配方可在玩家物品栏中使用。例如木棍的配方:

语法[编辑]

"minecraft:recipe_shaped": {
  "description": {
    "identifier": "<par1>"
  },
  "tags": <par2>,
  "group": "<par3>",
  "priority": <par4>,
  "pattern": <par5>,
  "key": <par6>,
  "result": <par7>
}

结构[编辑]

  •  minecraft:recipe_shaped:根对象。
    • *description:描述。
    • *tags:设置该配方的一个或多个标签
    •  group
    •  priority
    • *pattern:设置配方的排列图案顺序。该数组可包含1~3个字符串,它们依次表示配方中每一行的相对位置,其中每个字符串中的每个字符表示一个物品(空格用于占位,表示此配方中该位置不可有物品);一个字符串中可包含1~3个字符,这些字符表示配方中该行物品的相对位置;不同的字符用于表示不同类型的物品。下方给出了相应例子
    • *key:设置"pattern"中每种字符对应的物品(空格除外)。该对象中每个键值对的键名为"pattern"中的一种字符,键值为物品引用参数。例如:
      "key": {
        "A": {
          "item": "minecraft:coal",
          "data": 0
        },
        "B": {
          "item": "minecraft:stick"
        }
      }
      
    • *result:设置输出物品的赋命名空间标识符。

示例[编辑]

下面的示例所构建的配方将依照物品排列顺序把1本书、2个钻石和4个黑曜石合成为1个附魔台

{
  "format_version": "1.12",
  "minecraft:recipe_shaped": {
    "description": {
      "identifier": "minecraft:enchanting_table"
    },
    "tags": [ "crafting_table" ],
    "pattern": [
      " B ",
      "D#D",
      "###"
    ],
    "key": {
      "B": {
        "item": "minecraft:book"
      },
      "#": {
        "item": "minecraft:obsidian"
      },
      "D": {
        "item": "minecraft:diamond"
      }
    },
    "result": {
      "item": "minecraft:enchanting_table"
    }
  }
}

排列图案示例[编辑]

JSON 效果 注释
"pattern": [
  "AAA",
  " B ",
  "BBB"
]

空格可用于占位。
"pattern": [
  "AAA",
  "B",
  "BBB"
]

"pattern": [
  "CCC"
]

"pattern"数组中每个字符串占位一行。
"pattern": [
  "   ",
  "CCC",
  "   "
]

历史[编辑]

基岩版
??加入了minecraft:recipe_shaped

漏洞[编辑]

关于“minecraft:recipe_shaped”的漏洞在国际版中由漏洞追踪器维护,请在此报告漏洞。

Template:Navbox schema