[PR #2138] [MERGED] Breeding matches vanilla: rabbits breed, damage ends love, horse and wolf checks, XP follows mob drops #4041

Closed
opened 2026-11-03 04:14:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2138
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: fix/animal-breeding-rules


📝 Commits (1)

  • 23d089a Match vanilla animal breeding rules: rabbits breed, damage ends love, horse and wolf checks, breeding XP rule

📊 Changes

4 files changed (+46 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+12 -5)
📝 crates/horizon-client/src/mobs.rs (+10 -0)
📝 crates/horizon-client/src/mobs/goals.rs (+14 -6)
📝 crates/horizon-client/src/mobs/rabbit.rs (+10 -1)

📄 Description

What and why

Five differences from vanilla in animal breeding, all found by reading the vanilla code against Horizon's:

  • Rabbits never bred or followed carrots. Rabbits only had the generic panic, stroll and look goals. They now also get Breed (speed 0.8) and Tempt (speed 1.0, rabbit food: carrot, golden carrot, dandelion), at the vanilla priorities.
  • Damage did not cancel love. Mob::damage_with now clears in_love for animals when damage is actually taken (not when the hit is rejected or absorbed by the invulnerability window).
  • Horses bred while hurt or ridden. Horses, donkeys and llamas now need vanilla's canParent for the mob itself and for the partner: tame, adult, not a vehicle or passenger, at full health. Before, this check existed only for llamas, and only for the mob itself. Seen gets ridden and sitting so the partner can be checked.
  • A sitting wolf could be the partner. A sitting wolf is no longer picked as a partner (the sitting check on the mob itself already existed).
  • Breeding XP ignored the mob loot rule. The orb of 1 to 7 XP is now spawned only when the mob_drops game rule is on. This covers the orbs for all species, including llamas and sniffers, which come in as MobEvent::Experience.

Not changed: camels (Horizon does not treat them as tamed, so the horse check would stop them breeding), and a rabbit baby still takes its variant from the first parent only (vanilla mixes both parents and sometimes picks a random one).

Vanilla reference

  • Rabbit.registerGoals: BreedGoal(this, 0.8), TemptGoal(this, 1.0, RABBIT_FOOD, false).
  • Animal.actuallyHurt calls resetLove().
  • AbstractHorse.canParent; Horse.canMate, Donkey.canMate, Llama.canMate.
  • Wolf.canMate: false when the partner isInSittingPose().
  • Animal.finalizeSpawnChildFromBreeding: the ExperienceOrb only if GameRules.MOB_DROPS.

Self-check

cargo check -p horizon-client passes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2138 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/animal-breeding-rules` --- ### 📝 Commits (1) - [`23d089a`](https://github.com/horizon-rust/horizon/commit/23d089aa7c5bf68f0a5ab830bf2ae3264a636954) Match vanilla animal breeding rules: rabbits breed, damage ends love, horse and wolf checks, breeding XP rule ### 📊 Changes **4 files changed** (+46 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+12 -5) 📝 `crates/horizon-client/src/mobs.rs` (+10 -0) 📝 `crates/horizon-client/src/mobs/goals.rs` (+14 -6) 📝 `crates/horizon-client/src/mobs/rabbit.rs` (+10 -1) </details> ### 📄 Description ## What and why Five differences from vanilla in animal breeding, all found by reading the vanilla code against Horizon's: - **Rabbits never bred or followed carrots.** Rabbits only had the generic panic, stroll and look goals. They now also get `Breed` (speed 0.8) and `Tempt` (speed 1.0, rabbit food: carrot, golden carrot, dandelion), at the vanilla priorities. - **Damage did not cancel love.** `Mob::damage_with` now clears `in_love` for animals when damage is actually taken (not when the hit is rejected or absorbed by the invulnerability window). - **Horses bred while hurt or ridden.** Horses, donkeys and llamas now need vanilla's `canParent` for the mob itself and for the partner: tame, adult, not a vehicle or passenger, at full health. Before, this check existed only for llamas, and only for the mob itself. `Seen` gets `ridden` and `sitting` so the partner can be checked. - **A sitting wolf could be the partner.** A sitting wolf is no longer picked as a partner (the sitting check on the mob itself already existed). - **Breeding XP ignored the mob loot rule.** The orb of 1 to 7 XP is now spawned only when the `mob_drops` game rule is on. This covers the orbs for all species, including llamas and sniffers, which come in as `MobEvent::Experience`. Not changed: camels (Horizon does not treat them as tamed, so the horse check would stop them breeding), and a rabbit baby still takes its variant from the first parent only (vanilla mixes both parents and sometimes picks a random one). ## Vanilla reference - `Rabbit.registerGoals`: `BreedGoal(this, 0.8)`, `TemptGoal(this, 1.0, RABBIT_FOOD, false)`. - `Animal.actuallyHurt` calls `resetLove()`. - `AbstractHorse.canParent`; `Horse.canMate`, `Donkey.canMate`, `Llama.canMate`. - `Wolf.canMate`: false when the partner `isInSittingPose()`. - `Animal.finalizeSpawnChildFromBreeding`: the `ExperienceOrb` only if `GameRules.MOB_DROPS`. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:14:14 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4041
No description provided.