mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-01-23 16:30:19 +01:00
Got back nether:apple hunger code
- nether:apple increase hunger from 9 points
This commit is contained in:
parent
c9399edb70
commit
090d1689e3
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user