Make sure that the player is not in creative mode before giving them experience points

This commit is contained in:
Guy Liner 2022-01-05 10:42:50 -05:00
parent 385d34df33
commit 04a81af4a1
1 changed files with 6 additions and 1 deletions

View File

@ -317,7 +317,12 @@ 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)