Reliable Recipes

模组

· 作者 evanbones

一个轻量级工具,用于通过简单的 JSON 配置来操作配方和标签

0 本站下载 0 关注 更新于 2 周前

最新 3.9.0+26.3-neoforge · 26.3 · NeoForge

一键开服(送7天)

Reliable Recipes

一款功能强大且对开发者友好的实用工具,旨在通过简单的 JSON 配置来操作配方和标签。 Reliable Recipes 允许整合包创作者无需复杂的脚本编写(说的就是你,KubeJS!),仅使用标准的 JSON 文件即可轻松添加、移除或修改配方和标签。


快速上手

Reliable Recipes 会监控 Minecraft 实例中 reliable_recipes/ 文件夹内的 JSON 文件:

  • 位置: 将你的 JSON 文件放置在 ./config/reliable_recipes/(或 ./reliable_recipes/)中。也支持子目录。
  • 格式: 文件可以包含位于 JSON 数组中的修改规则,或者标准的 Minecraft/模组化配方 JSON 对象:
[
  {
    "action": "remove_recipe",
    "mod": "examplemod",
    "type": "minecraft:crafting_shaped"
  }
]

你也可以直接将独立的配方 JSON 文件(例如标准合成、熔炼、切石或酿造配方)放入 reliable_recipes/ 中,而无需构建数据包!


配方操作

在筛选出要修改的配方后,你可以使用 "action" 属性应用相应的操作。

1. remove_recipe(或 remove)

完全从游戏中移除匹配的配方。

{
  "action": "remove_recipe",
  "id": [
    "minecraft:wooden_pickaxe",
    "minecraft:wooden_hoe"
  ]
}

2. replace_input

扫描原料并将目标物品/标签替换为指定替代品。

  • target:要查找的物品 ID 或标签(例如 #minecraft:logs)。
  • replacement:用作替代的物品 ID 或标签。可以是字符串或物品数组。
{
  "action": "replace_input",
  "target": "minecraft:stick",
  "replacement": [
    "minecraft:bamboo",
    "minecraft:stick"
  ],
  "mod": "minecraft"
}

3. replace_output

更改匹配配方的产出结果。

  • replacement:输出的新物品 ID。
{
  "action": "replace_output",
  "replacement": "minecraft:golden_apple",
  "id": "minecraft:cake"
}

4. prevent_repair

阻止特定物品在所有标准修复方法中进行修复。支持物品 ID、标签("#minecraft:swords" 或 "minecraft:enchantable/durability")、正则表达式("/.*_pickaxe/")或数组。

{
  "action": "prevent_repair",
  "target": "minecraft:diamond_pickaxe"
}

5. set_repair_material

覆盖在砧上修复特定工具或武器所需的修复材料。支持物品 ID、标签("#c:iron_ingots"、"tag:c:iron_ingots")、正则表达式("/.*_slag/"),以及针对 target 和 material 的数组。

{
  "action": "set_repair_material",
  "target": "minecraft:diamond_sword",
  "material": "minecraft:dirt"
}

6. add_recipe(或 add)

直接添加自定义配方,无需数据包。适用于所有原版配方类型以及任何模组化的配方类型。

  • 配方 ID: 如果指定了 "id"(例如 "id": "reliable_recipes:custom_recipe"),则使用该 ID。如果省略,配方 ID 将根据文件名和路径自动生成。指定一个已存在的配方 ID 将会覆盖该配方。

使用 add_recipe 包装器的示例:

{
  "action": "add_recipe",
  "id": "reliable_recipes:dirt_to_stick",
  "recipe": {
    "type": "minecraft:crafting_shapeless",
    "ingredients": [
      {
        "item": "minecraft:dirt"
      }
    ],
    "result": {
      "count": 4,
      "id": "minecraft:stick"
    }
  }
}

或者直接放入原始配方 JSON: 任何标准的 Minecraft 配方 JSON 文件(例如 my_crafting_recipe.json 或 recipes/stonecutting/cut_copper.json)直接放置在 reliable_recipes/ 内都会自动加载!

{
  "type": "minecraft:crafting_shaped",
  "category": "misc",
  "key": {
    "#": {
      "item": "minecraft:stick"
    }
  },
  "pattern": [
    "###",
    "###",
    "###"
  ],
  "result": {
    "count": 1,
    "id": "minecraft:diamond"
  }
}

过滤器

过滤器决定哪些配方受影响。一个配方必须匹配所有提供的过滤字段才能被选中。

Field Description Example
output 产出的物品的注册表名称。 "minecraft:stone_pickaxe"
id 配方的特定 ID。 "minecraft:black_bed_from_white_bed"
mod 拥有该配方的模组 ID。 "farmersdelight" 或 ["create", "mekanism"]
type 配方类型。 "minecraft:smoking"
input 如果配方包含此原料则匹配。 "minecraft:stick" 或 "#minecraft:logs"

标签修改

从物品中剥离标签,或完全清空标签。这有助于清理 JEI/EMI 显示或隔离物品。

1. remove_all_tags(或 remove_tag)

从指定物品中移除所有标签关联。

{
  "action": "remove_all_tags",
  "id": [
    "minecraft:stick",
    "minecraft:cake"
  ]
}

2. remove_from_tag

从特定标签中移除特定物品。

{
  "action": "remove_from_tag",
  "tag": "minecraft:planks",
  "id": "minecraft:oak_planks"
}

3. clear_tag

清空指定标签中的所有物品/方块。

{
  "action": "clear_tag",
  "tags": [
    "curios:artifact"
  ]
}

合成转化(Crafting Transmute)向后移植

Reliable Recipes 向后移植了 minecraft:crafting_transmute 合成配方类型。这允许你在合成台中升级/转换物品,同时保留其所有物品组件(如耐久度、附魔和自定义名称)。

配方字段

  • input (Ingredient, 必填): 被升级的物品。
  • material (Ingredient, 必填): 所需的材料物品。
  • material_count (Int 或 min/max 范围, 可选, 默认为 1): 所需材料的数量(例如 1 或 {"min": 1, "max": 4})。
  • result (Item, 必填): 输出物品。
  • add_material_count_to_result (Boolean, 可选, 默认值: false): 如果为 true,放入合成台中的材料数量将加到结果数量中。

JSON 示例

{
  "type": "minecraft:crafting_transmute",
  "category": "equipment",
  "input": {
    "item": "minecraft:iron_pickaxe"
  },
  "material": {
    "item": "minecraft:gold_ingot"
  },
  "material_count": 1,
  "result": {
    "id": "minecraft:golden_pickaxe"
  }
}

数据驱动的酿造配方

Reliable Recipes 支持使用 26.3 版本 minecraft:brewing 配方格式的数据驱动酿造台配方。

配方字段

  • input (Object, 必填): 输入容器物品或药水堆叠(item/tag, 可选 potion_contents)。
  • reagent (Ingredient, 必填): 放置在酿造台顶部槽位的原料物品。
  • output (ItemStack, 必填): 带有组件的结果物品堆叠输出。

JSON 示例

{
  "type": "minecraft:brewing",
  "input": {
    "item": "minecraft:potion",
    "potion_contents": {
      "potions": "minecraft:awkward"
    }
  },
  "reagent": {
    "item": "minecraft:turtle_helmet"
  },
  "output": {
    "id": "minecraft:potion",
    "components": {
      "minecraft:potion_contents": {
        "potion": "minecraft:turtle_master"
      }
    }
  }
}

模组兼容性

  • Reliable Removal: 自动移除与 Reliable Removal 黑名单中隐藏的项目相关的配方和标签列表。
  • EMI 集成: 在 EMI 中将鼠标悬停在配方输出上时(处于开发模式),按下 Delete 键,即可自动向 ./config/reliable_recipes/generated_removals.json 添加一条移除规则。

文档与维基

如需更多高级示例和详细信息,请参阅我们的维基: Modded Minecraft Wiki


许可证

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源