From 20a30f9f44c0819b4c10606da7b5e212453e27c7 Mon Sep 17 00:00:00 2001 From: cora Date: Tue, 13 Sep 2022 03:39:59 +0200 Subject: [PATCH] Instakill mobs on punch in creative --- mods/ENTITIES/mcl_mobs/api.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 23bcbf37f..438f7f4f2 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -3148,6 +3148,10 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir) return end + if minetest.is_creative_enabled(hitter:get_player_name()) then + self.health = 0 + end + -- set/update 'drop xp' timestamp if hitted by player self.xp_timestamp = minetest.get_us_time() end