Buckshot 的饥饿感重做
我用一套标准化的代谢引擎替换了 Minecraft 原版中的饥饿度和生命恢复系统。所有动作都遵循基于逐刻(tick-by-tick)计算的严格卡路里消耗,所有可食用物品都会被物理分解为特定的宏量营养素。我引入了动态胃队列以及一组新的属性,以支持生存玩法中的物理消化和能量计算。
胃队列与消化
原版的 Minecraft 饥饿条存在根本性的缺陷。除了填满它以启用疾跑或治疗外,没有人真正与之互动,它仅仅作为一个静态计时器运行。我用受宏量营养素控制的物理胃队列替换了它。
当你消耗一个物品时,它不会填充全局数值栏。相反,它会被分解为碳水化合物、蛋白质、绿叶蔬菜、脂肪、药水或腐肉,并放入你的胃中。胃队列会根据这些营养素的生物功能自动排序。碳水化合物会绕过队列并在接近前端的位置注入自身,以提供即时的快速燃烧能量。脂肪则完全沉入队列底部,以便延迟并最终燃烧。蛋白质和绿叶蔬菜则自然地插入它们之间。
胃的运行受限于由你的“胃容量”属性决定的硬性物理容量。如果你超过这个容量,引擎将物理性地拒绝进一步的摄入。
动态卡路里消耗与睡眠机制
原版的疲劳度依赖任意性的动作追踪。我引入了基于物理速度和实体状态的逐刻卡路里消耗计算。
如果你静止站立,引擎会应用固定的闲置消耗。行走、游泳和疾跑会根据你实际的水平移动动态倍增这一消耗。你的“胃效率”属性决定了这些动作的最终消耗。
动作卡路里消耗 = 基础刻消耗 * 胃效率
度过夜晚需要支付计算过的费用,而不是作为免费的时间跳过。因为引擎知道标准的一夜大约持续 8000 刻,它会计算你确切的静息代谢率,以确定你是否能熬过这一夜。
预计夜间消耗 = 每刻睡眠消耗 * 8000
如果你当前正在消化的卡路里低于这个预计消耗,引擎会在物理上阻止你进入床铺,因为你的身体缺乏撑到黎明的能量。当你醒来时,引擎会计算经过的确切刻数,并从你的胃中扣除真实的卡路里消耗。
真正的细胞再生
原版的生命恢复被完全禁用。你的食物栏已满时,不再被动愈合。相反,你的恢复速率和效率由胃队列中的实际内容物在数学上决定。
在你的队列中正在消化的蛋白质充当恢复速度的倍增器,而药水和腐肉则施加严重的惩罚。你恢复的每一个生命值都会直接消耗你当前的卡路里池。
总治疗消耗 = 恢复量 * 治疗常数 * 胃效率
如果你没有足够的卡路里来处理这种细胞修复,你就无法愈合。如果你的胃完全排空,引擎会根据你的基础恢复属性诱导饥饿伤害。
动态代谢属性
为了支持整个数学框架,我引入了四个新的动态属性。这些统计数据自然缩放,并由胃队列中的内容物实时操纵。
胃容量 决定了你消化轨道的物理大小。默认情况下,玩家一次只能容纳恰好十个宏量营养素。由于这是一个标准属性,整合包开发者可以轻松地将它附加到自定义背包、重型盔甲或魔法饰品上,以扩大或缩小玩家的物理极限。
胃效率 是所有卡路里消耗的直接倍增器。基准值 1.0 意味着你的动作消耗标准能量。如果你的效率降至 0.5,你的新陈代谢高度优化,燃烧的卡路里减半。如果飙升至 2.0,你的身体会挣扎,并以两倍的速度燃烧能量。消化绿叶蔬菜在数学上提高你的效率,而携带有毒药水或遭受原版饥饿效果则会严重恶化它。
恢复量 确定在细胞修复周期中恢复的确切健康值。基准是一个生命值,但积极消化的蛋白质会对这一产量施加直接的百分比增加。相反,食用腐肉或胃为空会对你的治疗输出施加数学惩罚。
恢复间隔 定义了你的治疗周期的物理速度。默认情况下,你的身体尝试每 100 刻处理一次治疗。原版的再生药水效果不再提供免费的生命值;相反,它在数学上减少这个间隔,允许你的身体以极快的速度将卡路里转化为生命值。
配置与整合包集成
后端配置提供了对代谢引擎变量的直接控制。通用配置文件允许你调整每个宏量营养素提供的全局卡路里能量。通过更改一个变量,你可以使游戏中所有碳水化合物的基准能量翻倍,从而无需编辑单个食物物品。
食物行为和营养蓝图通过自定义 JSON 数据包系统进行控制,而不是硬编码的实例检查。你可以创建一个 JSON 文件来定义物品确切提供哪些营养素、物理进食需要多长时间以及它施加什么自定义药水效果。
例如,要配置一种需要 40 刻进食、清除物品上的所有原版药水效果、提供两个蛋白质和一个脂肪,并有 50% 几率导致缓慢的自定义烤火腿,JSON 结构编写如下:
{
"type": "item",
"target": "modid:glazed_ham",
"speed": "BIG",
"override_vanilla": true,
"nutrients": [
"PROTEIN",
"PROTEIN",
"FAT"
],
"effects": [
{
"id": "minecraft:slowness",
"duration": 200,
"amplifier": 0,
"probability": 0.5
}
]
}
由于这些营养物质的总体热量值由中心配置文件通过数学方式解析,因此通过此数据包结构引入的任何物品都能在代谢引擎中立即实现平衡。
性能与同步
该框架不使用危险的全局变量或硬编码的核心修改。通过利用现代 NeoForge 数据组件(Data Components)和流式编解码器(Stream Codecs),胃部数据直接附加到玩家实体上。
网络数据包仅在队列中发生物理变化时从服务器发送到客户端,从而确保完美同步且零网络冗余。原生的客户端检查会动态读取热量状态,以自然的方式阻止诸如冲刺等动作,而不会与原版游戏引擎产生冲突,每秒二十次精准执行复杂的代谢代数运算。
当前支持的模组:
Farmer's Delight
Crabber's Delight
End's Delight
My Nether's Delight
Miner's Delight
Dungeon Delight
Flight o' Delight
The Great Outdoors
YUNG's Cave Biomes
Untitled Duck Mod
Wan's Ancient Beasts
Quark
Buckshot's Hunger Rework
I replaced the vanilla hunger and health regeneration systems in Minecraft with a standardized metabolic engine. All actions follow a strict caloric cost calculated on a tick-by-tick basis, and all consumable items are physically broken down into specific macronutrients. I introduced a dynamic stomach queue and a new set of attributes to support physical digestion and energy calculation for survival gameplay.
The Stomach Queue and Digestion
The vanilla Minecraft hunger bar is fundamentally flawed. Nobody actually interacts with it beyond filling it to enable sprinting or healing, and it functions merely as a static timer. I replaced this with a physical stomach queue governed by macronutrients.
When you consume an item, it does not refill a global numerical bar. Instead, it is broken down into Carbohydrates, Proteins, Greens, Fats, Potions, or Rot, and placed into your stomach. The stomach queue automatically sorts these nutrients based on their biological function. Carbohydrates bypass the queue and inject themselves near the front to provide immediate fast-burning energy. Fats sink completely to the bottom of the queue for a delayed and eventual burn. Proteins and Greens slot naturally between them.
The stomach operates with a hard physical capacity dictated by your Stomach Capacity attribute. If you exceed this capacity, the engine physically rejects further consumption.
Dynamic Calorie Drain and Sleep Mechanics
Vanilla exhaustion relies on arbitrary action tracking. I introduced a tick-by-tick caloric drain calculation based on physical velocity and entity state.
If you are standing still, the engine applies a flat idle cost. Walking, swimming, and sprinting dynamically multiply this cost based on your actual horizontal movement. Your Stomach Efficiency attribute dictates the final cost of these actions.
Action Calorie Cost = Base Tick Cost * Stomach Efficiency
Sleeping through the night requires a calculated toll rather than acting as a free time skip. Because the engine knows a standard night takes roughly 8000 ticks, it calculates your exact resting metabolic rate to determine if you can survive the night.
Estimated Night Cost = Sleep Cost Per Tick * 8000
If your currently digesting calories are lower than this estimated cost, the engine physically blocks you from entering a bed because your body lacks the energy to make it to morning. When you wake up, the engine calculates the exact number of ticks passed and subtracts the true caloric cost from your stomach.
True Cellular Regeneration
Vanilla health regeneration is entirely disabled. You will no longer passively heal simply because your food bar is full. Instead, your healing rate and efficiency are mathematically dictated by the actual contents of your stomach queue.
Proteins currently digesting in your track act as multipliers to your regeneration speed, while Potions and Rot apply severe penalties. Every single hit point you recover directly taxes your current calorie pool.
Total Heal Cost = Regen Amount * Heal Cost Constant * Stomach Efficiency
If you do not have the required calories to process this cellular repair, you will not heal. If your stomach empties completely, the engine induces starvation damage based on your baseline regeneration attribute.
Dynamic Metabolic Attributes
To support this entire mathematical framework, I introduced four new dynamic attributes. These stats scale naturally and are manipulated in real-time by the contents of your stomach queue.
Stomach Capacity dictates the physical size of your digestion track. By default, a player can hold exactly ten macronutrients at once. Because this is a standard attribute, modpack developers can easily attach it to custom backpacks, heavy armor, or magical baubles to expand or shrink the player's physical limits.
Stomach Efficiency acts as a direct multiplier to all caloric drain. A baseline value of 1.0 means your actions cost standard energy. If your efficiency drops to 0.5, your metabolism is highly optimized and you burn half the required calories. If it spikes to 2.0, your body struggles and burns energy twice as fast. Digesting Greens mathematically improves your efficiency, while carrying toxic Potions or suffering from the vanilla Hunger effect severely worsens it.
Regeneration Amount determines exactly how much health is restored during a cellular repair cycle. The baseline is a single hit point, but actively digesting Proteins applies a direct percentage increase to this yield. Conversely, eating Rot or having an empty stomach applies a mathematical penalty to your healing output.
Regeneration Interval defines the physical speed of your healing cycles. By default, your body attempts to process a heal every 100 ticks. The vanilla Regeneration potion effect no longer grants free health; instead, it mathematically reduces this interval, allowing your body to convert calories into health at a vastly accelerated rate.
Configuration and Modpack Integration
The backend configuration provides direct control over the metabolic engine variables. The common configuration file allows you to adjust the global caloric energy granted by each macronutrient. You can double the baseline energy of all Carbohydrates across the entire game by changing one variable, removing the need to edit individual food items.
Food behaviors and nutritional blueprints are controlled via a custom JSON datapack system rather than hardcoded instance checks. You can create a JSON file to define exactly what nutrients an item provides, how long it physically takes to eat, and what custom potion effects it applies.
For example, to configure a custom glazed ham that takes 40 ticks to eat, wipes all vanilla potion effects from the item, provides two Proteins and one Fat, and has a 50 percent chance to cause Slowness, the JSON structure is written exactly like this:
{
"type": "item",
"target": "modid:glazed_ham",
"speed": "BIG",
"override_vanilla": true,
"nutrients": [
"PROTEIN",
"PROTEIN",
"FAT"
],
"effects": [
{
"id": "minecraft:slowness",
"duration": 200,
"amplifier": 0,
"probability": 0.5
}
]
}
Because the overarching caloric values of these nutrients are mathematically resolved by the central configuration file, any item introduced via this datapack structure is instantly balanced within the metabolic engine.
Performance and Synchronization
The framework operates without dangerous global variables or hardcoded core modifications. By utilizing modern NeoForge Data Components and Stream Codecs, the stomach data is attached directly to the player entity.
Network packets are only dispatched from the server to the client when physical changes occur in the queue, ensuring perfect synchronization with zero network bloat. Native client-side checks dynamically read the caloric state to naturally block actions like sprinting without fighting the vanilla game engine, flawlessly executing complex metabolic algebra twenty times a second.
Current Supported Mods:
Farmer's Delight
Crabber's Delight
End's Delight
My Nether's Delight
Miner's Delight
Dungeon Delight
Flight o' Delight
The Great Outdoors
YUNG's Cave Biomes
Untitled Duck Mod
Wan's Ancient Beasts
Quark
评论 0
登录后参与评分
还没有评论,来抢沙发吧