added heal API

This commit is contained in:
discon-nected 2019-04-09 06:17:03 +12:00 committed by GitHub
parent 0691a672cb
commit 0c8202df51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,6 +105,14 @@ minetest.register_on_respawnplayer(function(player)
hbhunger.exhaustion[name] = 0
end)
function hbhunger.heal(player)
-- reset hunger (and save)
local name = player:get_player_name()
hbhunger.hunger[name] = 30
hbhunger.set_hunger_raw(player)
hbhunger.exhaustion[name] = 0
end
local main_timer = 0
local timer = 0
local timer2 = 0