forked from mtcontrib/mobs_animal
		
	have chance of chicken dropping a feather
This commit is contained in:
		
							
								
								
									
										21
									
								
								chicken.lua
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								chicken.lua
									
									
									
									
									
								
							@@ -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
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user