Make hunger effects player attributes
Currently all hunger effects (healing, starving, hunger itself) are set server-wide for all players.
For more options to be controlled by other mods and on a per-player basis those hunger effects should be settable as player attributes.
- Default is enabled for all values
- Not persistent so the default is restored when the mod that changed it is disabled. Mods need to track status on their own it they want persistence between disconnects and need to re-apply their settings.
- This will not replace the current
hunger_ng.configure_hunger()
function because this function configures hunger for a player in general the effects configuration just changes the hunger effects.
API functions
Configuration
hunger_ng.set_effect('Foobar', 'hunger', 'setting')
hunger_ng.set_effect('Foobar', 'starving', 'setting')
hunger_ng.set_effect('Foobar', 'healing', 'setting')
Where setting
is either enabled
or disabled
.
Player Meta
hunger_ng:status_hunger
hunger_ng:status_starving
hunger_ng:status_healing
Get Status
Status will be implemented to hunger_ng.get_hunger_information()
and will cause an API incompatibility for the effects
sub table and will extend the hunger
sub table.
hunger = {
-- ...
enabled = true
}
effects = {
-- ...
starving = { enabled = true, status = false },
healing = { enabled = true, status = false },
},
Edited by Dirk