
生命恢复机制重构
此API将生命回复改为由属性驱动,并(可选地)禁用饥饿/饱和度系统。
生命恢复系统重构
此API改变了生命值的恢复方式。不再依赖饥饿系统,而是使用实体属性。
原版的饥饿系统(包括消耗和饱和度)默认被禁用。
此外,新增了一个名为 healthregenerationoverhaul:reserved_health 的实体属性,并修复了玩家重生/进入世界时生命值被限制在最高20点的原版漏洞。
默认实现
生命值每 healthregenerationoverhaul:health_tick_threshold 个游戏刻通过 healthregenerationoverhaul:health_regeneration 恢复一次。
当生命值减少时,恢复会暂停 healthregenerationoverhaul:health_regeneration_delay_threshold 个游戏刻。
healthregenerationoverhaul:reserved_health 描述了当前不可用的最大生命值百分比。
默认属性值
- healthregenerationoverhaul:health_regeneration:0
- healthregenerationoverhaul:health_tick_threshold:100
- healthregenerationoverhaul:health_regeneration_delay_threshold:100
- healthregenerationoverhaul:reserved_health:0
自定义
当原版游戏规则“natural_health_regeneration”为 true 时,玩家额外获得 1 点生命恢复。
在客户端配置中可以启用并自定义替代生命条。
服务器配置提供选项来设置每个属性(包括 max_health)的默认值。这仅影响玩家的属性值,不影响其他实体。
同样在服务器配置中,可以重新启用原版食物系统。
API
将“LivingEntity”强制转换为“HealthRegeneratingEntity”接口,即可访问所有相关方法。
正在加载版本记录…
正在加载评论…
评论在新手盒子客户端中发表,这里同步展示。