Mana Attributes
This API implements a mana system controlled through entity attributes.
Basic Implementation
Living entities can possess mana reserves up to the value of _generic.max_mana. Mana regeneration occurs at the rate of _generic.mana_regeneration every _generic.mana_tick_threshold game ticks.
When mana is consumed, its regeneration is paused for _generic.mana_regeneration_delay_threshold ticks.
The _generic.reserved_mana parameter determines the percentage of maximum mana reserves that are currently unavailable for use.
When mana level drops to zero or below, regeneration stops for _generic.depleted_mana_regeneration_delay_threshold ticks.
Default Attribute Values
- _generic.max_mana: 0
- _generic.mana_regeneration: 0
- _generic.mana_tick_threshold: 20
- _generic.mana_regeneration_delay_threshold: 20
- _generic.depleted_mana_regeneration_delay_threshold: 60
- _generic.reserved_mana: 0
System Configuration
When the "naturalManaRegeneration" game rule is activated, players receive additional mana regeneration of 1 unit.
Client configuration allows customization of interface elements displaying mana information.
Programming Interface
To access all main system functions, it's necessary to convert a "LivingEntity" object to the "ManaUsingEntity" interface.