+ if self.deactivating == false then
+ global_mob_amount = global_mob_amount + 1
+ print("Mob Spawned. Current Mobs: "..global_mob_amount)
+ elseif self.deactivating == true then
+ minetest.after(0, function()
+ if not self.object:get_luaentity() then
+ global_mob_amount = global_mob_amount - 1
+ print("Mob Deactivated. Current Mobs: "..global_mob_amount)
+ end
+ end)
+ end
+