[PR #7137] [MERGED] A baby dolphin takes nobody as its target #7366

Closed
opened 2026-11-03 06:38:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7137
Author: @MSedgeMC
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/dolphin-baby-target


📝 Commits (1)

  • 2e9421e A baby dolphin takes nobody as its target

📊 Changes

3 files changed (+41 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/mobs/dolphin.rs (+35 -0)
📝 crates/horizon-client/src/mobs/goals.rs (+5 -0)
📝 tools/port_map/game-010.tsv (+1 -1)

📄 Description

Vanilla's Dolphin.canAttack returns !this.isBaby() && super.canAttack(target), so a baby dolphin never takes anything as its target and does not fight back when it is hit.

Horizon's mobs/goals.rs::spares_target, which the hurt-by and target goals consult in place of Mob.canAttack, knew only about a golem sparing creepers, so a hurt baby dolphin picked its attacker as its target like an adult.

Proven: on the build VM, cargo test -q -p horizon-client-lib --lib mobs::dolphin::target_tests passes the new a_baby_dolphin_spares_whatever_hurt_it; with the four new lines in spares_target deleted the same test fails (FAILED. 0 passed; 1 failed). cargo clippy -q -p horizon-client-lib --lib prints nothing and rustfmt --edition 2024 --check passes on both files. The vanilla rule is javap -p -c net.minecraft.world.entity.animal.dolphin.Dolphin -> canAttack (isBaby, then AgeableWaterCreature.canAttack).

Not proven: I did not run the game, so I have not seen a baby dolphin stay passive; the in-game check is hitting a baby dolphin and watching it swim away instead of turning on the player.

Corrects the Dolphin.canAttack row of tools/port_map/game-010.tsv.


🔄 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/7137 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/dolphin-baby-target` --- ### 📝 Commits (1) - [`2e9421e`](https://github.com/horizon-rust/horizon/commit/2e9421e2c4984040f36bf0b40b76d4fe0769ed72) A baby dolphin takes nobody as its target ### 📊 Changes **3 files changed** (+41 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/dolphin.rs` (+35 -0) 📝 `crates/horizon-client/src/mobs/goals.rs` (+5 -0) 📝 `tools/port_map/game-010.tsv` (+1 -1) </details> ### 📄 Description Vanilla's `Dolphin.canAttack` returns `!this.isBaby() && super.canAttack(target)`, so a baby dolphin never takes anything as its target and does not fight back when it is hit. Horizon's `mobs/goals.rs::spares_target`, which the hurt-by and target goals consult in place of `Mob.canAttack`, knew only about a golem sparing creepers, so a hurt baby dolphin picked its attacker as its target like an adult. **Proven:** on the build VM, `cargo test -q -p horizon-client-lib --lib mobs::dolphin::target_tests` passes the new `a_baby_dolphin_spares_whatever_hurt_it`; with the four new lines in `spares_target` deleted the same test fails (`FAILED. 0 passed; 1 failed`). `cargo clippy -q -p horizon-client-lib --lib` prints nothing and `rustfmt --edition 2024 --check` passes on both files. The vanilla rule is `javap -p -c net.minecraft.world.entity.animal.dolphin.Dolphin` -> `canAttack` (`isBaby`, then `AgeableWaterCreature.canAttack`). **Not proven:** I did not run the game, so I have not seen a baby dolphin stay passive; the in-game check is hitting a baby dolphin and watching it swim away instead of turning on the player. Corrects the `Dolphin.canAttack` row of `tools/port_map/game-010.tsv`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:38:23 +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#7366
No description provided.