mirror of
https://codeberg.org/tenplus1/mobs_animal.git
synced 2024-12-22 17:00:26 +01:00
Added on_spawn example
This commit is contained in:
parent
e6d9611c2e
commit
752ab3db98
13
rat.lua
13
rat.lua
@ -57,7 +57,18 @@ mobs:register_mob("mobs_animal:rat", {
|
||||
]]
|
||||
})
|
||||
|
||||
mobs:register_spawn("mobs_animal:rat", {"default:stone"}, 20, 5, 15000, 2, 0)
|
||||
--mobs:register_spawn("mobs_animal:rat", {"default:stone"}, 20, 5, 15000, 2, 0)
|
||||
|
||||
local function rat_spawn(self, pos)
|
||||
print (self:get_luaentity().name, pos.x, pos.y, pos.z)
|
||||
end
|
||||
|
||||
mobs:spawn({
|
||||
name = "mobs_animal:rat",
|
||||
nodes = {"default:stone"},
|
||||
max_height = 0,
|
||||
-- on_spawn = rat_spawn,
|
||||
})
|
||||
|
||||
mobs:register_egg("mobs_animal:rat", S("Rat"), "mobs_rat_inventory.png", 0)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user