Malnourished
基本信息
| 属性 | 值 |
|---|---|
| 注册名 | nutrition:malnourished(Potion.setPotionName → potion.nutrition:malnourished) |
| 效果类型 | 减益(bad Potion,PotionCustom(id, true, icon)) |
| 修饰属性 | SharedMonsterAttributes.maxHealth(UUID ea9cebf7-7c7a-4a89-a04f-221dab8ffdf7) |
| 图标资源 | assets/nutrition/textures/potions/malnourished.png |
| 应用时长 | 619 ticks(约 30.95 秒),由 EffectsManager.reapplyEffects 每 110 ticks 续期 |
功能
营养不足时扣减玩家最大生命值,是 mod 的"不好好吃饭"惩罚机制。
实现
public class PotionMalnourished extends PotionCustom {
PotionMalnourished(int id, ResourceLocation icon) {
super(id, true, icon);
}
@Override
public double func_111183_a(int amplifier, AttributeModifier modifier) {
if (modifier.getID().equals(ModPotions.MALNOURISHMENT_HEALTH)) {
return -(amplifier + 1); // Half-heart per level
}
return 0D;
}
}
数值公式
maxHealth 减少 = (amplifier + 1) HP
| amplifier | 减少 HP | 减少红心 |
|---|---|---|
| 0 | 1 | 0.5 |
| 1 | 2 | 1 |
| 2 | 3 | 1.5 |
| 4 | 5 | 2.5 |
注意原版 Minecraft 玩家默认 20 HP(10 红心),多个效果叠加后可能直接造成"站立死亡"风险。
触发条件
和 Nourished 一样,EffectsList 没有显式注册 Malnourished,需第三方 mod 或自定义 mod 扩展通过 INutritionManager + 自定义 Effect.builder(...) 调用。