Add mob spawning underground
parent
66a5c55ba7
commit
efc7ddb4e5
|
@ -1,2 +1,8 @@
|
|||
# Folders
|
||||
.vscode
|
||||
.env
|
||||
|
||||
# Files
|
||||
ns_vl_caves_schist_large.png
|
||||
ns_vl_caves_gneiss_large.png
|
||||
show.py
|
||||
|
|
21
init.lua
21
init.lua
|
@ -304,6 +304,16 @@ function internal.register_ore(def)
|
|||
})
|
||||
end
|
||||
|
||||
function internal.register_monster_spawn(name, biomes, interval, chance, aoc)
|
||||
return mcl_mobs:spawn_specific(
|
||||
"mobs_mc:" .. name, "overworld", "ground", biomes, 0, 7,
|
||||
interval, chance, aoc, mcl_vars.mg_overworld_min,
|
||||
mcl_vars.mg_overworld_max, nil, function(self, pos)
|
||||
minetest.debug("Spawned " .. name .. " at position " .. minetest.pos_to_string(pos))
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
-- Register a new deepslate-like stone type.
|
||||
-- {
|
||||
-- -- Name of the deepslate type. Required.
|
||||
|
@ -528,6 +538,17 @@ function internal.overwrite_register_biome()
|
|||
OLD_REGISTER_BIOME(slate_def)
|
||||
OLD_REGISTER_BIOME(schist_def)
|
||||
OLD_REGISTER_BIOME(gneiss_def)
|
||||
|
||||
local biome_names = { slate_def.name, schist_def.name, gneiss_def.name }
|
||||
|
||||
internal.register_monster_spawn("zombie", biome_names, 30, 1000, 4)
|
||||
internal.register_monster_spawn("rover", biome_names, 30, 100, 2)
|
||||
internal.register_monster_spawn("skeleton", biome_names, 20, 800, 2)
|
||||
internal.register_monster_spawn("spider", biome_names, 30, 1000, 2)
|
||||
internal.register_monster_spawn("stalker", biome_names, 20, 1000, 2)
|
||||
internal.register_monster_spawn("villager_zombie", biome_names, 30, 50, 4)
|
||||
internal.register_monster_spawn("zombie", biome_names, 30, 1000, 4)
|
||||
internal.register_monster_spawn("baby_zombie", biome_names, 30, 50, 4)
|
||||
else
|
||||
return OLD_REGISTER_BIOME(def)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue