VoxeLibre/mods/ENTITIES/mobs_mc/5_spawn_abm_check.lua
Wuzzy 2dbda44a93 Add some global spawn restrictions
- no monsters on mycelium
- nothing on non-opaque blocks, except air
2018-06-03 17:48:32 +02:00

10 lines
352 B
Lua

function mobs:spawn_abm_check(pos, node, name)
if (node.name == "air") then
return true
elseif (node.name == "mcl_core:mycelium" or node.name == "mcl_core:mycelium_snow") and minetest.registered_entities[name].type == "monster" then
return false
elseif minetest.get_item_group(node.name, "opaque") ~= 0 then
return false
end
return true
end