diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua index 0f7470ac9..5dc0b8884 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua @@ -72,6 +72,7 @@ mobs.enter_breed_state = function(self,clicker) end self.breed_lookout_timer = self.breed_lookout_timer_goal self.bred = true + mobs.play_sound_specific(self,"mobs_mc_animal_eat_generic") return(true) end @@ -173,6 +174,8 @@ mobs.make_baby_grow_faster = function(self,clicker) clicker:set_wielded_item(stack) end + mobs.play_sound_specific(self,"mobs_mc_animal_eat_generic") + return(true) end end diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/sound_handling.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/sound_handling.lua index 182b762e2..98d2644e8 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/sound_handling.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/sound_handling.lua @@ -43,5 +43,17 @@ mobs.random_sound_handling = function(self,dtime) mobs.play_sound(self,"random") self.random_sound_timer = math_random(self.random_sound_timer_min,self.random_sound_timer_max) end +end +--used for playing a non-mob internal sound at random pitches +mobs.play_sound_specific = function(self,soundname) + local pitch = (100 + math_random(-15,15) + math_random()) / 100 + local distance = self.sounds.distance or 16 + + minetest.sound_play(soundname, { + object = self.object, + gain = 1.0, + max_hear_distance = distance, + pitch = pitch, + }, true) end \ No newline at end of file