No longer regen health at 0.5s at full hunger bar
This commit is contained in:
parent
075e1e7e48
commit
08beecbc29
|
@ -254,13 +254,10 @@ minetest.register_globalstep(function(dtime)
|
||||||
local h = tonumber(mcl_hunger.get_hunger(player))
|
local h = tonumber(mcl_hunger.get_hunger(player))
|
||||||
local hp = player:get_hp()
|
local hp = player:get_hp()
|
||||||
if timer > 0.5 then
|
if timer > 0.5 then
|
||||||
-- Quick heal (every 0.5s)
|
-- Slow health regeneration, and hunger damage (every 4s).
|
||||||
if h >= 20 and hp > 0 and hp < 20 then
|
-- Regeneration rate based on tutorial video <https://www.youtube.com/watch?v=zs2t-xCVHBo>.
|
||||||
-- +1 HP, +exhaustion
|
-- Minecraft Wiki seems to be wrong in claiming that full hunger gives 0.5s regen rate.
|
||||||
player:set_hp(hp+1)
|
if timerMult == 0 then
|
||||||
mcl_hunger.exhaust(name, mcl_hunger.EXHAUST_REGEN)
|
|
||||||
-- Slow heal, and hunger damage (every 4s)
|
|
||||||
elseif timerMult == 0 then
|
|
||||||
if h >= 18 and hp > 0 and hp < 20 then
|
if h >= 18 and hp > 0 and hp < 20 then
|
||||||
-- +1 HP, +exhaustion
|
-- +1 HP, +exhaustion
|
||||||
player:set_hp(hp+1)
|
player:set_hp(hp+1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user