配方

本页面主要解释如何向您的服务器添加新的配方

配方设置的配置部分名为 "recipes"。请确保所有配方配置都位于 YAML 文件根节点下的 "recipes"部分。

标签

在 CraftEngine 中,插件允许您使用标签,您也可以创建自定义标签。要使用标签,只需遵循以下格式即可:#namespace:tag

在以下示例中,我为 palm_planks 添加了两个原版标签,使它们能够参与使用这两个标签的所有数据包内的配方。

items:
  default:palm_planks:
    material: paper
    custom-model-data: 1004
    settings:
      fuel-time: 300
    tags:
      - "minecraft:planks"
      - "minecraft:wooden_tool_materials"
    data:
      display-name: "<!i>棕榈木板"
      #译者注:如果你使用1.21.4+版本可以使用下面的方式配置物品名称
      # item-name: "棕榈木板"
    model:
      type: "minecraft:model"
      path: "minecraft:item/custom/palm_planks"
      generation:
        parent: "minecraft:block/custom/palm_planks"
    behavior:
      type: block_item
      block: default:palm_planks

分组 / 类别

recipes:
  default:palm_planks:
    type: shapeless
    category: building
    group: planks
    ingredients:
      A: "#default:palm_logs"
    result:
      id: default:palm_planks
      count: 4

group 决定该配方在客户端解锁后属于哪个分组。group 可以是您自由选择的任何名称。但请避免使用非法字符。

category 决定了该配方在标签栏中位于哪个标签页。category 类型是有限的。

  • 对于烹饪或烧炼类的配方,选项包括 foodblocksmisc

  • 对于合成类的配方,选项包括 buildingredstoneequipmentmisc

有序合成配方

recipes:
  default:topaz_shovel:
    type: shaped
    pattern:
      - "A"
      - "B"
      - "B"
    ingredients:
      A: "default:topaz"
      B: "minecraft:stick"
    result:
      id: default:topaz_shovel
      count: 1
recipes:
  default:chinese_lantern:
    type: shaped
    pattern:
      - "ABA"
      - "BCB"
      - "ABA"
    ingredients:
      A: "#minecraft:planks"
      B: "minecraft:stick"
      C: "minecraft:torch"
    result:
      id: default:chinese_lantern
      count: 1

无序合成配方

recipes:
  default:palm_planks:
    type: shapeless
    category: building
    group: planks
    ingredients:
      A: "#default:palm_logs"
    result:
      id: default:palm_planks
      count: 4

烧炼配方

烧炼配方包括smeltingblastingsmokingcampfire_cooking。无论类型如何,配置格式都是一样的。

recipes:
  default:topaz_from_smelting_topaz_ore:
    type: smelting
    experience: 1.0
    category: misc
    group: topaz
    time: 200
    ingredient: "default:topaz_ore"
    result:
      id: default:topaz
      count: 1
  default:topaz_from_smelting_deepslate_topaz_ore:
    type: smelting
    experience: 1.0
    category: misc
    group: topaz
    time: 200
    ingredient: "default:deepslate_topaz_ore"
    result:
      id: default:topaz
      count: 1

切石机配方

切石机配方是一种比较特殊的配方类型。我不建议使用自定义物品作为原料,因为这极有可能导致严重的客户端视觉问题。

recipes:
  default:stone_cutting_example:
    type: stone_cutting
    group: topaz
    ingredient: "minecraft:stone"
    result:
      id: default:topaz
      count: 1

最后更新于

这有帮助吗?