From 28c8dc9c5310f4d9aa63e1b149705dda8f2c0c0a Mon Sep 17 00:00:00 2001 From: GuyLiner Date: Mon, 6 Feb 2023 09:19:56 -0500 Subject: [PATCH] If player in creative mode, don't drop experience from destroyed spawners --- mods/ITEMS/mcl_mobspawners/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_mobspawners/init.lua b/mods/ITEMS/mcl_mobspawners/init.lua index b3cd8a67f0..eee6b76007 100644 --- a/mods/ITEMS/mcl_mobspawners/init.lua +++ b/mods/ITEMS/mcl_mobspawners/init.lua @@ -317,7 +317,11 @@ minetest.register_node("mcl_mobspawners:spawner", { if obj then obj:remove() end - mcl_experience.throw_xp(pos, math.random(15, 43)) + --Make sure the player is not in creative mode before + --giving them xp + if not minetest.is_creative_enabled(name) then + mcl_experience.throw_xp(pos, math.random(15, 43)) + end end, on_punch = function(pos)