use mobs:add_mob function

This commit is contained in:
tenplus1 2023-09-25 13:17:48 +01:00
parent 0983d875ba
commit e644a1b523
1 changed files with 8 additions and 5 deletions

View File

@ -102,7 +102,7 @@ mobs:register_mob("mobs_animal:chicken", {
pos = pos, pos = pos,
gain = 1.0, gain = 1.0,
max_hear_distance = 5 max_hear_distance = 5
}) }, true)
end end
}) })
@ -174,10 +174,13 @@ mobs:register_arrow("mobs_animal:egg_entity", {
return return
end end
local staticdata = minetest.serialize( mobs:add_mob(pos, {
{child = true, tamed = true, owner = self.playername}) name = "mobs_animal:chicken",
child = true,
minetest.add_entity(pos, "mobs_animal:chicken", staticdata) owner = self.playername,
-- nametag = "Chicky",
ignore_count = true -- ignores mob count per map area
})
end end
}) })