此 Farmer's Delight 插件 在游戏中实现了一套全新的模块化烹饪系统。
目前,它仅支持 Fabric 版本,即 Farmer's Delight Refabricated —— 尽管我计划稍后将其移植到 Forge 和 NeoForge。
工作原理
属性(Properties) 应用于每一个“食材”物品,并决定该食材在加入餐食时产生的效果。一个属性最多可定义三种效果:
- 环境效果(Ambient effect) —— 一种被动增益,在餐食消化期间持续生效。
- 条件(Condition) —— 触发餐食激活效果所需满足的条件。
- 激活效果(Activated effect) —— 当条件满足时实际发生的效果。

新增了一个方块——高汤锅(Stockpot),可通过加热来烹制餐食。其界面包含三个输入槽、一个盛放存储槽、一个碗槽和一个输出槽。这三个输入槽分别对应三种属性效果——第一个槽位对应环境效果,第二个对应条件,第三个对应激活效果。加热后,这三个槽位中的食材将组合成一道自定义餐食。就像原版烹饪锅一样,你只能使用碗才能取出食物——否则它会留在锅中,即使锅被破坏也是如此。

自定义餐食会根据你所添加的食材拥有自定义的名称、颜色和模型,并在悬浮提示中显示所使用的具体物品以及食用该餐食时的效果描述。每种食材还会贡献其自身的饥饿值(减半)、饱和度(减半)以及任何内置的药水效果——包括来自药水本身的效果。如果多个食材提供了相同的效果,它们的持续时间会叠加,并采用其中最高的增幅等级。

食用自定义餐食后,你将获得 消化(Digestion) 效果。在背包中悬停在该效果上,会显示所有当前正在生效的餐食及其各自的效果,并单独列出。你可以同时拥有多种不同的活跃餐食——但如果你食用了一道与你已激活的餐食完全相同的三种食材组成的餐食,它只会刷新该餐食的计时器,而不会叠加第二份。

无限可能!
本模组自带 16 种内置属性,即使在默认设置下,也能组合出数千种功能上独特的餐食。但这仅仅是起点——类似于 Origins 模组,该系统的所有部分均由数据包驱动,因此任何人都可以在不触碰一行代码的情况下添加、移除或重塑属性。
制作你自己的属性
属性文件位于 data/<namespace>/modular_delight/properties/<id>.json。以下是一个完整的示例:
{
"name": "Juicy",
"ambient": {
"attribute": {
"id": "minecraft:generic.movement_speed",
"amount": 0.1,
"operation": "multiply_total",
"description_divisor": 0.01,
"description": "grants you +%s%% movement speed"
}
},
"condition": {
"type": "modulardelight:sprinting",
"multiplier": 0.5,
"cooldown_ticks": 200
},
"activated": {
"action": {
"type": "modulardelight:status_effect",
"effect": "minecraft:speed",
"duration_ticks": 100,
"scale_amplifier": true
},
"description": "gain Speed %s for %ss"
}
}
在开始使用时,有几件事值得注意:
ambient、condition 和 activated 对于组件注册都是可选的 —— 省略你不需要的部分即可。
ambient 支持同时应用多种效果 —— 在一个属性中堆叠多个 attributes、status_effects 和 damage_reactions。
- 条件可以组合 —— 使用
modulardelight:all_of / modulardelight:any_of,并且任何条件都可以通过 "inverted": true 进行反转。
- 激活动作是完全可组合的 —— 使用
modulardelight:multi 链接多个动作,使用 modulardelight:if/modulardelight:chance/modulardelight:choice 进行分支,使用 modulardelight:delay 延迟其中一个动作,或直接通过 modulardelight:run_command 执行原始命令。还有更多内置选项可用。
- 要将属性挂钩到实际物品上,请在
data/<namespace>/tags/items/properties/<property_id>.json 下对它们进行标签化——这与原版用于任何物品标签的模式相同。
- 想完全禁用某个内置属性?只需在同一路径(
data/modulardelight/modular_delight/properties/<id>.json)下使用你自己的文件,内容仅为 { "remove": true }。
还有很多其他钩子可以使用——自定义餐食名称过滤、特定食材组合的硬编码名称/模型覆盖、自定义环境反应,以及所有内置条件和动作类型的完整列表。如需完整参考,请访问 GitHub;如需帮助(+ 模板数据包),请访问 Discord。另一个很好的资源是直接查看 Origins Wiki,虽然这是一个完全不同的模组,但它可能会对你有所帮助。
附加信息
如果你发现任何错误,请向 Bug Tracker 报告。

本模组深受 EightSidedSquare 制作的 Potluck 启发!
本页展示的图片已更新——并非所有视觉效果都与当前版本的模组完全一致。
This Farmer's Delight addon implements a new modular cooking system into the game.
For now, it only supports the Fabric version, Farmer's Delight Refabricated - although I plan to port it to Forge and NeoForge later on.
How It Works
Properties are applied to every "ingredient" item, and determine what that ingredient does when added to a meal. A property can define up to three effects:
- An ambient effect - a passive bonus, active the whole time the meal is digesting.
- A condition - something you have to do to trigger the meal's activated effect.
- An activated effect - what actually happens when the condition is met.

A new block, the Stockpot, can be heated to cook meals. Its interface has three input slots, a serving storage slot, a bowl slot, and an output slot. The three input slots correspond to the three property effects - the first slot to the ambient effect, the second to the condition, and the third to the activated effect. Once heated, the ingredients in those three slots combine into a custom meal. Just like the vanilla Cooking Pot, you can only take a serving out with a bowl - otherwise it stays in the pot, even if the pot is broken.

Custom meals get custom names, colors, and models based on the ingredients you add, along with a tooltip showing the exact items used and a description of what the meal does when eaten. Every ingredient also contributes its own hunger (halved), saturation (halved), and any built-in potion effects it carries - including from potions themselves. If the same effect comes from multiple ingredients, their durations stack together, using the highest amplifier among them.

After eating a custom meal, you get the Digestion effect. Hovering over it in your inventory shows every currently active meal and what each one does, separated out individually. You can have multiple different meals active at once — but eating a meal with the exact same three ingredients as one you already have active will just refresh its timer rather than stack a second copy.

Infinite Possibilities!
The mod ships with 16 built-in properties, and even at default settings that adds up to thousands of functionally unique meals. But that's just the starting point - like the Origins mod, every part of this system is fully datapack-driven, so anyone can add, remove, or reshape properties without touching a line of code.
Making Your Own Property
Properties live at data/<namespace>/modular_delight/properties/<id>.json. Here's a complete example:
{
"name": "Juicy",
"ambient": {
"attribute": {
"id": "minecraft:generic.movement_speed",
"amount": 0.1,
"operation": "multiply_total",
"description_divisor": 0.01,
"description": "grants you +%s%% movement speed"
}
},
"condition": {
"type": "modulardelight:sprinting",
"multiplier": 0.5,
"cooldown_ticks": 200
},
"activated": {
"action": {
"type": "modulardelight:status_effect",
"effect": "minecraft:speed",
"duration_ticks": 100,
"scale_amplifier": true
},
"description": "gain Speed %s for %ss"
}
}
A few things worth knowing as you get started:
ambient, condition, and activated are all optional for component registration - Leave out the ones you don't want.
ambient supports multiple effects at once - stack up several attributes, status_effects, and damage_reactions in one property.
- Conditions can be combined with
modulardelight:all_of / modulardelight:any_of, and any condition can be flipped with "inverted": true.
- Activated actions are fully composable - chain multiple actions with
modulardelight:multi, branch with modulardelight:if/modulardelight:chance/modulardelight:choice, delay one with modulardelight:delay, or drop straight into a raw command with modulardelight:run_command. There are more built in options, too.
- To hook a property up to actual items, tag them under
data/<namespace>/tags/items/properties/<property_id>.json - same pattern vanilla uses for any item tag.
- Want to disable one of the built-in properties entirely? Use your own file at the same path (
data/modulardelight/modular_delight/properties/<id>.json) with just { "remove": true }.
There's plenty more you can hook into - custom meal name filtering, hardcoded name/model overrides for specific ingredient combos, custom ambient reactions, and the full list of built-in condition and action types. For the complete reference, visit the GitHub, and for help (+ a template datapack), visit the Discord. Another great resource is simply looking and the Origins Wiki, although quite a different mod - it may help.
Extra
If you see any bugs, report them to the Bug Tracker.

This mod is greatly inspired by Potluck made by EightSidedSquare!
Images featured on this page have since been updated - not all visuals are fully accurate to the current version of the mod.
评论 0
登录后参与评分
还没有评论,来抢沙发吧