Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
EasyAutoHeal
[AI-generated] Auto-drinks a healing mead from your inventory when HP drops below 20 or 10% of max, and only when 2+ foods are eaten. Prefers strongest mead (configurable). Client-only, no server sync.
By s6652289
| Last updated | 5 days ago |
| Total downloads | 99 |
| Total rating | 0 |
| Categories | Mods AI Generated |
| Dependency string | s6652289-EasyAutoHeal-1.0.1 |
| Dependants | 0 other packages depend on this package |
This mod requires the following mods to function
denikson-BepInExPack_Valheim
BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.
Preferred version: 5.4.2350README
EasyAutoHeal
自动喝治疗蜜酒 —— 血量危险时从背包里挑一瓶治疗蜜酒自动喝掉,纯客户端模组。
[AI-generated] 本模组由 AI 生成(源码、文档、图标)。
功能
- 触发条件(任一满足)
- 当前生命值 < 固定阈值(默认 20 滴)
- 当前生命值 ÷ 生命上限 < 百分比阈值(默认 10%,分母含食物加成)
- 满血硬保护:生命值等于上限时绝不触发。就算把阈值配成超过血量上限的值 (例如固定阈值填 200 而上限只有 150),也不会满血浪费蜜酒。
- 空肚保护:吃下的食物数量少于 2 个 时绝不触发(可配置 0~3), 刚出生 / 清空食物栏时不会白白浪费蜜酒。
- 蜜酒识别:不写死物品名 —— 运行时扫描背包消耗品,凡「喝下后带 HP 恢复效果」的 (次级 / 中级 / 缓愈治疗蜜酒以及未来的同类物品)都能识别。
- 优先级:背包里同时有多种时,默认先喝最强的一瓶(可改为先喝最弱的,省着好药)。
- 不浪费:走游戏原版
Player.ConsumeItem链路 —— 蜜酒的回复/冷却效果还在身上时, 游戏本身就会拒绝再喝,一瓶都不会被消耗;喝下后另有 10 秒保护冷却。 - 提示:喝下时屏幕左上角弹一条提示(可关)。
配置(BepInEx/config/easyautoheal.client.only.cfg)
| 分区 | 键 | 默认 | 说明 |
|---|---|---|---|
| 1 - Auto Heal | Enabled | true | 总开关 |
| FixedHpThreshold | 20 | 固定血量阈值(滴) | |
| PercentHpThreshold | 10 | 百分比阈值(%) | |
| MinFoods | 2 | 至少吃下几个食物才允许触发(0-3) | |
| CheckInterval | 0.5 | 检查间隔(秒) | |
| CooldownSeconds | 10 | 喝下后的保护冷却(秒) | |
| StrongestFirst | true | true=先喝最强;false=先喝最弱 | |
| ShowMessage | true | 喝下时左上角提示 |
⚠️ 与所有 BepInEx 配置一样:改 cfg 前先退游戏,游戏运行中手改会被覆盖。
兼容性
- 纯客户端:无 Jotunn、无 ServerSync、无 NetworkCompatibility 声明(NotEnforced)。
- 联机:主机不装也能用(只动本地玩家自己的背包,走原版消耗链路)。
- 只读不改任何 prefab 数值。
安装
r2modman「Install from file」选 EasyAutoHeal-1.0.1.zip,
或把 EasyAutoHeal.dll 丢进 BepInEx/plugins/。
前置:BepInExPack_Valheim 5.4.2350。
版本
- 1.0.1(2026-09-17):修掉「不判血量、满血也一直喝药」。
1.0.0 误把
Character.GetHealthPercentage()当 0–100 的百分数用, 但它的 IL 实测是GetHealth() / GetMaxHealth()—— 返回 0.0–1.0 的比例,没有 ×100。 于是pct < 10恒为真 ⇒ 百分比条件永远满足 ⇒ 只要背包有药、食物够 2 个就喝, 与当前血量无关(实测日志:hp=150/150,1%也喝)。 现改为自己按 0–100 计算,cfg 语义不变(PercentHpThreshold=10依然表示 10%); 另加满血硬保护,日志也升级为打出完整判定依据。 - 1.0.0(2026-09-17):首个版本。