forked from mtcontrib/mobs_animal
Fixed chicken laying egg
This commit is contained in:
parent
85eaef6dff
commit
029c1fc437
25
chicken.lua
25
chicken.lua
@ -59,19 +59,20 @@ mobs:register_mob("mobs_animal:chicken", {
|
|||||||
|
|
||||||
do_custom = function(self)
|
do_custom = function(self)
|
||||||
|
|
||||||
if not self.child
|
if self.child
|
||||||
and math.random(1, 500) == 1 then
|
or math.random(1, 2000) > 1 then
|
||||||
|
return
|
||||||
local pos = self.object:getpos()
|
|
||||||
|
|
||||||
minetest.add_item(pos, "mobs:egg")
|
|
||||||
|
|
||||||
minetest.sound_play("default_place_node_hard", {
|
|
||||||
pos = pos,
|
|
||||||
gain = 1.0,
|
|
||||||
max_hear_distance = 5,
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local pos = self.object:getpos()
|
||||||
|
|
||||||
|
minetest.add_item(pos, "mobs:egg")
|
||||||
|
|
||||||
|
minetest.sound_play("default_place_node_hard", {
|
||||||
|
pos = pos,
|
||||||
|
gain = 1.0,
|
||||||
|
max_hear_distance = 5,
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user