Skip to content

Health Regeneration Overhaul

This API changes how health regeneration works and disables the food system.

89k downloads Updated

Last update on each platform

No ratings yet

Be the first to rate it.

Rate it

Community listing page

Community listing page, reviews may not be monitored by the author.

About

Description

Health Regeneration Overhaul

This API changes the way health is regenerated. Instead of depending on the hunger system, two new entity attributes are used.
The hunger system including exhaustion and saturation is disabled by default, but it can be re-enabled in the server config.

Default implementation

Health is regenerated by generic.health_regeneration every generic.health_tick_threshold ticks.

When health is reduced, regeneration is stopped for generic.health_regeneration_delay_threshold ticks.

Default attribute values

  • generic.health_regeneration: 0
  • generic.health_tick_threshold: 100
  • generic.health_regeneration_delay_threshold: 100

Customization

When the vanilla gamerule "naturalRegeneration" is true, players have a health regeneration of at least 1.

In the client config an alternative health bar can be enabled and customized.

API

Casting a "LivingEntity" to the "HealthRegeneratingEntity" interface gives access to all relevant methods.

Health Regeneration Overhaul

This API changes the way health is regenerated. Instead of depending on the hunger system, entity attributes are used.

The vanilla hunger system including exhaustion and saturation is disabled by default.

Additionally, an entity attribute called healthregenerationoverhaul:reserved_health is added and a vanilla bug that clamps player health to a maximum of 20 when respawning/joining a world has been fixed.

Default implementation

Health is regenerated by healthregenerationoverhaul:health_regeneration every healthregenerationoverhaul:health_tick_threshold ticks.

When health is reduced, regeneration is stopped for healthregenerationoverhaul:health_regeneration_delay_threshold ticks.

healthregenerationoverhaul:reserved_health describes the percentage amount of maximum health that is currently not available.

Default attribute values

  • healthregenerationoverhaul:health_regeneration: 0
  • healthregenerationoverhaul:health_tick_threshold: 100
  • healthregenerationoverhaul:health_regeneration_delay_threshold: 100
  • healthregenerationoverhaul:reserved_health: 0

Customization

When the vanilla game rule "natural_health_regeneration" is true, players have 1 additional health regeneration.

In the client config an alternative health bar can be enabled and customised.

The server config has options to set the default value for each attribute (including max_health). This only affects the attribute values for players, not other entities.

Also in the server config, the vanilla food system can be re-enabled.

API

Casting a "LivingEntity" to the "HealthRegeneratingEntity" interface gives access to all relevant methods.