From 7491ef5d44d904c11e24a35a0ca30d5fc58c9f13 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Mon, 22 Apr 2024 02:26:26 +0200 Subject: [PATCH] Added on_save_effect support for mobs --- mods/ENTITIES/mcl_mobs/api.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index f44c42da3..15be76731 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -109,6 +109,12 @@ function mob_class:get_staticdata() end tmp._mcl_potions = self._mcl_potions + if tmp._mcl_potions then + for name_raw, data in pairs(tmp._mcl_potions) do + local def = mcl_potions.registered_effects[name_raw:match("^_EF_(.+)$")] + if def and def.on_save_effect then def.on_save_effect(self.object) end + end + end return minetest.serialize(tmp) end