Got back nether:apple hunger code

- nether:apple increase hunger from 9 points
This commit is contained in:
LeMagnesium 2015-04-22 19:44:46 +02:00
parent c9399edb70
commit 090d1689e3
1 changed files with 11 additions and 0 deletions

View File

@ -367,6 +367,17 @@ minetest.register_node("nether:apple", {
return itemstack
end
local p_hunger = tonumber(hud.hunger[user:get_player_name()])
if not p_hunger then
return
end
p_hunger = p_hunger + 9
if p_hunger > 30 then
p_hunger = 30
end
hud.hunger[user:get_player_name()] = p_hunger
hud.set_hunger(user)
local amount = math.random(4, 6)
inv:add_item("main", {name="nether:blood_extracted", count=math.floor(amount/3)})
user:set_hp(user:get_hp()-amount)