1
0
mirror of https://codeberg.org/tenplus1/mobs_animal.git synced 2024-12-22 17:00:26 +01:00

have chance of chicken dropping a feather

This commit is contained in:
tenplus1 2023-12-16 08:32:32 +00:00
parent 7b76829046
commit bf12043fdc

View File

@ -89,20 +89,25 @@ mobs:register_mob("mobs_animal:chicken", {
end
self.egg_timer = 0
if self.child
or math.random(100) > 1 then
if self.child then
return
end
local pos = self.object:get_pos() ; if not pos then return end
minetest.add_item(pos, "mobs:egg")
if math.random(100) == 1 then
minetest.sound_play("default_place_node_hard", {
pos = pos,
gain = 1.0,
max_hear_distance = 5
}, true)
minetest.add_item(pos, "mobs:egg")
minetest.sound_play("default_place_node_hard", {
pos = pos,
gain = 1.0,
max_hear_distance = 5
}, true)
elseif math.random(100) < 3 then
minetest.add_item(pos, "mobs:chicken_feather")
end
end
})