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 end
self.egg_timer = 0 self.egg_timer = 0
if self.child if self.child then
or math.random(100) > 1 then
return return
end end
local pos = self.object:get_pos() ; if not pos 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", { minetest.add_item(pos, "mobs:egg")
pos = pos,
gain = 1.0, minetest.sound_play("default_place_node_hard", {
max_hear_distance = 5 pos = pos,
}, true) gain = 1.0,
max_hear_distance = 5
}, true)
elseif math.random(100) < 3 then
minetest.add_item(pos, "mobs:chicken_feather")
end
end end
}) })