summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-05-18 14:18:04 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2016-05-18 14:18:04 +0100
commit029c1fc4377c7f6e9395682846eed47419a1f55c (patch)
treed284e8e90fb1a629351951070979a42f0ccd6902
parent85eaef6dff0ff6a80e70a79e22133b004c23ab6a (diff)
Fixed chicken laying egg
-rw-r--r--chicken.lua21
1 files changed, 11 insertions, 10 deletions
diff --git a/chicken.lua b/chicken.lua
index 716dbeb..a23b997 100644
--- a/chicken.lua
+++ b/chicken.lua
@@ -59,19 +59,20 @@ mobs:register_mob("mobs_animal:chicken", {
do_custom = function(self)
- if not self.child
- and math.random(1, 500) == 1 then
+ if self.child
+ or math.random(1, 2000) > 1 then
+ return
+ end
- local pos = self.object:getpos()
+ local pos = self.object:getpos()
- minetest.add_item(pos, "mobs:egg")
+ minetest.add_item(pos, "mobs:egg")
- minetest.sound_play("default_place_node_hard", {
- pos = pos,
- gain = 1.0,
- max_hear_distance = 5,
- })
- end
+ minetest.sound_play("default_place_node_hard", {
+ pos = pos,
+ gain = 1.0,
+ max_hear_distance = 5,
+ })
end,
})