function defense_mob_api.library.make_sound(self, event_name, detached, gain, pitch, max_hear_dist)
	local def =
	{
		object = self.object,
		gain = gain or 0.5 + math.random() * 0.5,
		pitch = pitch or 1 + (math.random() - 0.5) * 0.5, 
		max_hear_distance = max_hear_dist,
	}
	if detached then def.object = nil end
	
	return minetest.sound_play(self.media_prefix .. event_name, def)
end
