diff --git a/crates/horizon-client/src/mobs/ai.rs b/crates/horizon-client/src/mobs/ai.rs index 49e5e2ffa..a5ab1d16e 100644 --- a/crates/horizon-client/src/mobs/ai.rs +++ b/crates/horizon-client/src/mobs/ai.rs @@ -1466,6 +1466,18 @@ pub fn voice_sounds(m: &Mob) -> [&'static str; 3] { }; [ambient, m.kind.sounds[1], m.kind.sounds[2]] } + // Horse.getAmbientSound, getHurtSound and getDeathSound by age. + Species::Horse if m.is_baby() => [ + "entity.baby_horse.ambient", + "entity.baby_horse.hurt", + "entity.baby_horse.death", + ], + // SkeletonHorse.getAmbientSound: its own under water. + Species::SkeletonHorse if m.fluids.eye_in_water => [ + "entity.skeleton_horse.ambient_water", + m.kind.sounds[1], + m.kind.sounds[2], + ], // The mob's sound variant set, the baby one for a baby. Species::Pig | Species::Cow | Species::Chicken | Species::Wolf | Species::Cat => { use super::finalize::variant_sound as v; diff --git a/crates/horizon-client/src/mobs/equine.rs b/crates/horizon-client/src/mobs/equine.rs index 1e35aa81e..26ee8cfae 100644 --- a/crates/horizon-client/src/mobs/equine.rs +++ b/crates/horizon-client/src/mobs/equine.rs @@ -292,13 +292,17 @@ pub fn make_mad(m: &mut Mob, events: &mut Vec) { m.extra.counter = 20; m.extra.flag = false; } + // getAngrySound: null (silent) for the skeleton horse. let sound = match m.species() { + Species::SkeletonHorse => return, Species::Donkey => "entity.donkey.angry", Species::Mule => "entity.mule.angry", + Species::ZombieHorse => "entity.zombie_horse.angry", Species::Llama | Species::TraderLlama => "entity.llama.angry", + _ if m.is_baby() => "entity.baby_horse.angry", _ => "entity.horse.angry", }; - events.push(MobEvent::Sound(sound, m.center(), 1.0, 1.0)); + m.voice(sound, events); } /// `RandomStandGoal`. #[derive(Clone, Debug)] @@ -324,10 +328,11 @@ impl Goal for RandomStand { fn start(&mut self, m: &mut Mob, cx: &mut Cx) { m.extra.counter = 20; m.extra.flag = false; - if m.species() == Species::Horse { - cx.events - .push(MobEvent::Sound("entity.horse.angry", m.center(), 1.0, 1.0)); - } + // playStandSound: getAmbientStandSound is the ambient sound, plain + // playSound(sound) at volume and pitch 1. + let sound = super::ai::voice_sounds(m)[0]; + let at = [m.position.x, m.position.y, m.position.z]; + cx.events.push(MobEvent::Sound(sound, at, 1.0, 1.0)); } } /// Horses that step with `AbstractHorse.playStepSound` (llamas and camels