From 1f4c8eb25ac4e8674da211055dd4d28caa07a3ca Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Tue, 3 Oct 2023 15:20:20 +0100 Subject: [PATCH] slight pause after beehive damage --- bee.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bee.lua b/bee.lua index 12778f0..1937ea9 100644 --- a/bee.lua +++ b/bee.lua @@ -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)