[PR #4481] [MERGED] Parrots follow other mobs and hover near them (FollowMobGoal) #5646

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4481
Author: @xFedeT
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/parrot-follow-mob-goal


📝 Commits (2)

  • bddb7c3 Parrots follow other mobs and hover near them (FollowMobGoal)
  • d671006 FollowMob matches vanilla tick for tick: goal name, update interval, mob_ai scenarios

📊 Changes

5 files changed (+150 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/mobs/goals.rs (+112 -0)
📝 crates/horizon-client/src/mobs/tame.rs (+1 -0)
📝 tools/lan_e2e.py (+30 -0)
📝 tools/port_map/game-009.tsv (+1 -1)
📝 tools/test_mob_ai_parity.py (+6 -0)

📄 Description

🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally.

Refs #3521

What and why

Vanilla's Parrot.registerGoals ends with FollowMobGoal(this, 1.0, 3.0F, 7.0F) at priority 3: a parrot flies after the first visible mob of another class within 7 blocks (its box grown by 7) and stops about 3 blocks from it, backing off when it is nearer than that. register_parrot had every other goal but this one, so a wild parrot only wandered.

New FollowMob goal (mobs/goals.rs), registered in register_parrot: canUse takes the first other mob (another species, not invisible) whose box meets the grown one; canContinueToUse while the path runs and it is farther than 3; start/stop set and restore the water malus; tick looks at it, and every adjustedTickDelay(10) either paths to it (moveTo(entity), reach 1) or, within the stop distance, stops and walks away from it (distSqr <= stopDistance, written without squaring as in vanilla). Left out: the extra "followed mob's look control wants this position" test; only another FollowMobGoal mob of a different class could look at it, and parrots are the only ones with the goal.

Proof, from the real game

python3 tools/lan_e2e.py --server-thread --check parrot_follows_mob: a wild parrot is summoned 6 blocks from a cow on an open floor; the guest samples their distance 12 times over 240 ticks. With the goal the median is 2.6 blocks (sorted: 1.88 … 4.29) and the parrot hovers by the cow; without it (the same check with the registration commented out) the median is 4.56 and the parrot stays on the ground off to the side. The check asserts a median of at most 3.5.

Without the goal With the goal (the parrot is over the cow)

pr_ready --quick: fmt, clippy, 1053 tests and 481 python tests pass; parity harnesses left to CI. Row FollowMobGoal updated in the port map.

🤖 Generated with Claude Code


🔄 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/4481 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/parrot-follow-mob-goal` --- ### 📝 Commits (2) - [`bddb7c3`](https://github.com/horizon-rust/horizon/commit/bddb7c34be109a922741305052b8e7561fa3433d) Parrots follow other mobs and hover near them (FollowMobGoal) - [`d671006`](https://github.com/horizon-rust/horizon/commit/d671006122c496cc583195f82849de7df46121fc) FollowMob matches vanilla tick for tick: goal name, update interval, mob_ai scenarios ### 📊 Changes **5 files changed** (+150 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/goals.rs` (+112 -0) 📝 `crates/horizon-client/src/mobs/tame.rs` (+1 -0) 📝 `tools/lan_e2e.py` (+30 -0) 📝 `tools/port_map/game-009.tsv` (+1 -1) 📝 `tools/test_mob_ai_parity.py` (+6 -0) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally. Refs #3521 ## What and why Vanilla's `Parrot.registerGoals` ends with `FollowMobGoal(this, 1.0, 3.0F, 7.0F)` at priority 3: a parrot flies after the first visible mob of another class within 7 blocks (its box grown by 7) and stops about 3 blocks from it, backing off when it is nearer than that. `register_parrot` had every other goal but this one, so a wild parrot only wandered. New `FollowMob` goal (`mobs/goals.rs`), registered in `register_parrot`: `canUse` takes the first other mob (another species, not invisible) whose box meets the grown one; `canContinueToUse` while the path runs and it is farther than 3; `start`/`stop` set and restore the water malus; `tick` looks at it, and every `adjustedTickDelay(10)` either paths to it (`moveTo(entity)`, reach 1) or, within the stop distance, stops and walks away from it (`distSqr <= stopDistance`, written without squaring as in vanilla). Left out: the extra "followed mob's look control wants this position" test; only another `FollowMobGoal` mob of a different class could look at it, and parrots are the only ones with the goal. ## Proof, from the real game `python3 tools/lan_e2e.py --server-thread --check parrot_follows_mob`: a wild parrot is summoned 6 blocks from a cow on an open floor; the guest samples their distance 12 times over 240 ticks. With the goal the median is 2.6 blocks (sorted: 1.88 … 4.29) and the parrot hovers by the cow; without it (the same check with the registration commented out) the median is 4.56 and the parrot stays on the ground off to the side. The check asserts a median of at most 3.5. | Without the goal | With the goal (the parrot is over the cow) | |---|---| | ![](https://raw.githubusercontent.com/xFedeT/horizon/pr-screenshots/parrot-follow/without-goal.png) | ![](https://raw.githubusercontent.com/xFedeT/horizon/pr-screenshots/parrot-follow/with-goal.png) | `pr_ready --quick`: fmt, clippy, 1053 tests and 481 python tests pass; parity harnesses left to CI. Row `FollowMobGoal` updated in the port map. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:14:03 +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#5646
No description provided.