diff --git a/mods/herbs/init.lua b/mods/herbs/init.lua index bb64584..c3ac93c 100644 --- a/mods/herbs/init.lua +++ b/mods/herbs/init.lua @@ -25,7 +25,14 @@ minetest.register_craftitem("herbs:aloe_vera", { inventory_image = "herbs_aloe_vera_plant.png", groups = {}, on_use = function(itemstack, user, pointed_thing) - + local hp = user:get_hp() + if hp < 20 then + hp = hp + 1 + if hp > 20 then + hp = 20 + end + user:set_hp(hp) + end end, }) diff --git a/mods/hunger/functions.lua b/mods/hunger/functions.lua index 3dfff07..db1f9ba 100644 --- a/mods/hunger/functions.lua +++ b/mods/hunger/functions.lua @@ -143,13 +143,13 @@ local function hunger_globaltimer(dtime) local name = player:get_player_name() local tab = hunger[name] if tab then - local air = player:get_breath() or 0 +-- local air = player:get_breath() or 0 local hp = player:get_hp() -- heal player by 1 hp if not dead and saturation is > 15 (of 30) player is not drowning - if tonumber(tab.lvl) > HUNGER_HEAL_LVL and hp > 0 and air > 0 then - player:set_hp(hp + HUNGER_HEAL) - end +-- if tonumber(tab.lvl) > HUNGER_HEAL_LVL and hp > 0 and air > 0 then +-- player:set_hp(hp + HUNGER_HEAL) +-- end -- or damage player by 1 hp if saturation is < 2 (of 30) if tonumber(tab.lvl) < HUNGER_STARVE_LVL then