Merge pull request #2240 from kacpherek/fix/goat-breed-milk

🤖 Agent: Read against the vanilla 26.3 sources (Let goats breed, follow wheat and be milked) and proven in contrib-gate-21's union of 72 kacpherek PRs: 95 parity harnesses on playhorizon and the Mac mini, clippy, 1534 tests, lan_e2e 23 checks in-frame and with --server-thread. Thanks @kacpherek!
This commit is contained in:
Ludovic Marie
2026-10-27 11:27:45 +01:00
committed by GitHub
2 changed files with 24 additions and 0 deletions
@@ -2968,6 +2968,16 @@ impl Game<'_> {
consume = true;
sound = Some("entity.cow.milk");
}
// Goat.mobInteract: a bucket on an adult gives milk.
Species::Goat if item == "minecraft:bucket" && !m.is_baby() => {
give = Some("minecraft:milk_bucket");
consume = true;
sound = Some(if m.extra.screaming {
"entity.goat.screaming.milk"
} else {
"entity.goat.milk"
});
}
Species::Mooshroom if item == "minecraft:bowl" && !m.is_baby() => {
give = Some("minecraft:mushroom_stew");
consume = true;
+14
View File
@@ -321,6 +321,20 @@ fn generic(m: &mut Mob) {
m.ai.targets.add(1, HurtByTarget::new());
m.ai.targets.add(2, NearestTarget::player(true));
} else {
if m.kind.species == Species::Goat {
// GoatAi's idle and core behaviours (the ram and long jump
// activities are not here): panic 2.0, AnimalMakeLove, tempting
// with goat_food and baby follow at 1.25, then stroll.
g.add(0, Float);
g.add(1, Panic::new(2.0));
g.add(2, Breed::new(1.0));
g.add(3, Tempt::new(1.25, m.kind.food.clone(), false));
g.add(4, FollowParent::new(1.25));
g.add(5, Stroll::avoiding_water(1.0));
g.add(6, LookAtPlayer::new(6.0));
g.add(7, RandomLookAround::default());
return;
}
g.add(0, Float);
let rabbit = m.kind.species == Species::Rabbit;
g.add(1, Panic::new(if rabbit { 2.2 } else { 1.25 }));