1
0
mirror of https://codeberg.org/tenplus1/mobs_animal.git synced 2024-12-22 08:50:26 +01:00

slight pause after beehive damage

This commit is contained in:
tenplus1 2023-10-03 15:20:20 +01:00
parent cd5afc920a
commit 1f4c8eb25a

View File

@ -122,7 +122,14 @@ minetest.register_node(":mobs:beehive", {
on_punch = function(pos, node, puncher)
-- yep, bee's don't like having their home punched by players
puncher:set_hp(puncher:get_hp() - 4)
minetest.after(0.2, function()
local hp = puncher and puncher:get_hp()
if hp then
puncher:set_hp(hp - 4)
end
end)
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)