The intent is for mobs modders to be able to define where their mobs should spawn, and be able to assign the mobs to those places in bulk. Add a dependency to mobshabitats or just copy-in the api.lua file.
Spoiler
Using a centralized file where you can define the spawning of various mob "families" is much more maintainable too
- * Define main characteristics of a habitats
* Define group mobs into families
* Assign individual mobs or mob groups to habitats
* Simple syntax, defaults taken care of
Spoiler
default:snowymountains
default:desert
default:savannah
default:icesea
default:shore
default:sea
default:seabed
default:river
default:riverbed
default:forest
default:pineforest
default:jungle
default:caves
default:tallcaves
default:lavapit
default:dungeon
default:sky
Code: Select all
-- ethereal biomes
mobsbiomes:add_biome("ethereal:firepits",{
floors = {"ethereal:fiery_dirt"},
plants = {"ethereal:dry_shrub"},
walls = {"default:obsidian"},
})
mobsbiomes:add_biome("ethereal:bamboo",{
floors = "ethereal:bamboo_dirt",
trees = "ethereal:bamboo",
plants = "ethereal:bush",
})
-- spawning example
if minetest.get_modpath("dmobs") then
mobsbiomes:add_spawn("dmobs:panda","ethereal:bamboo") -- use default spawning values from mobsbiomes
end
if minetest.get_modpath("mobs_monster") then
mobsbiomes:add_family("firemonsters",{
lavaflan = {mobstring="mobs_monster:lavaflan",spawnon="floors",spawnby="walls"},
dungeonmaster = {mobstring="mobs_monster:dungeon_master",spawnon="floors",spawnby="walls",max_light=10},
})
mobsbiomes:add_family("groundmonsters",{
oerkki = {mobstring="mobs_monster:oerkki",spawnon="floors",spawnby="walls"},
stonemonster = {mobstring="mobs_monster:stone_monster",spawnon="floors",spawnby="walls"},
})
mobsbiomes:add_family_spawn("firemonsters","ethereal:firepits")
mobsbiomes:add_family_spawn("groundmonsters","ethereal:firepits")
mobsbiomes:add_family_spawn("groundmonsters","default:caves")
end
Zip: https://github.com/taikedz-mt/mobs_habi ... master.zip
License: LGPLv3