[PR #2770] [MERGED] Allays fly: travelFlying for their travel and hovering stroll targets #4594

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2770
Author: @socksprox
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @ludovic111

Base: main ← Head: fix/2594-allay-travel-flying


📝 Commits (1)

  • c216561 Allays fly: their travel is travelFlying and their stroll hovers

📊 Changes

4 files changed (+57 additions, -5 deletions)

View changed files

📝 crates/horizon-client/src/mobs/ai.rs (+1 -0)
📝 crates/horizon-client/src/mobs/allay.rs (+10 -1)
📝 crates/horizon-client/src/mobs/goals.rs (+22 -1)
📝 crates/horizon-client/src/mobs/living.rs (+24 -3)

📄 Description

🤖 Opened by socksprox's AI agent (Devin), not by socksprox himself.

Fixes #2594.

What and why

An allay spawned or placed stood on the ground and fell when the block under it was broken — the reporter watched it drop "as if it wasn't a flying entity". Two pieces were missing versus the 26.3 spec:

  • Allay.travel: vanilla calls travelFlying(input, this.getSpeed()), a travel with no gravity term at all. Horizon dispatched the allay to the ordinary travel_in_air, which subtracts the 0.08 gravity attribute whenever noGravity is off — and noGravity is only set while a MoveTo is active, so an idle allay always sank. Family::Allay now has a custom_travel arm (allay::travel) calling travelFlying at the speed its move control set; travel_flying is split into travel_flying_speeds so the water/lava/air speeds can differ per mob (an allay flies at LivingEntity.speed, a ghast at a constant 0.02).
  • WaterAvoidingRandomFlyingGoal.getPosition: Stroll::flying asked default_random_pos for a land spot, so a hovering allay never got a stroll target either (the "stood still" half of the report). It now tries HoverRandomPos.getPos(mob, 8, 7, dir, pi/2, 3, 1) on the view direction, falling back to AirAndWaterRandomPos.getPos(mob, 8, 4, -2, dir, pi/2) — both helpers already existed for other goals. The wither registers the same vanilla goal and gets the same correction for free.

Vanilla reference

  • net.minecraft.world.entity.animal.allay.Allay#travel → LivingEntity#travelFlying
  • net.minecraft.world.entity.ai.goal.WaterAvoidingRandomFlyingGoal#getPosition → HoverRandomPos/AirAndWaterRandomPos
  • net.minecraft.world.entity.ai.control.FlyingMoveControl (allay: maxTurn 20, hoversInPlace true)

Verification

  • cargo check -p horizon-client --lib clean; pr_ready block below.
  • tools/test_mob_ai_parity.py --only allay_airborne (a scenario I added locally, not committed): the probe's allay spawned at y=-55 now stays at -55, RandomStrollGoal fires and it drifts to air targets — previously it fell to the ground and stood still. The scenario isn't committed because the probe doesn't model the allay's Brain (act/mem fields) and the ambient interval is still 120 vs vanilla's 80 — the latter is already covered by open PR #2247, so the trace can't match end-to-end yet.

pr_ready (tools/pr_ready.py --quick on MacBookPro, against origin/main at 783577d2d, 8 min 56 s)

Check Result
Scope ✅ 5 files, +57 −5
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 325 passed (27 s)
rustfmt ✅ (5 s)
clippy ✅ (1 s)
tests: horizon-client ✅ 1281 passed (7 min 33 s)
doc tests ✅ 0 passed (47 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 290 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, breaking_model, cauldron, chunk_generation, command_exec, command_parse and 278 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Devin


🔄 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/2770 **Author:** [@socksprox](https://github.com/socksprox) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/2594-allay-travel-flying` --- ### 📝 Commits (1) - [`c216561`](https://github.com/horizon-rust/horizon/commit/c216561daa315d03b4c8c7edcd6ffed677f928c2) Allays fly: their travel is travelFlying and their stroll hovers ### 📊 Changes **4 files changed** (+57 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/ai.rs` (+1 -0) 📝 `crates/horizon-client/src/mobs/allay.rs` (+10 -1) 📝 `crates/horizon-client/src/mobs/goals.rs` (+22 -1) 📝 `crates/horizon-client/src/mobs/living.rs` (+24 -3) </details> ### 📄 Description > 🤖 Opened by socksprox's AI agent (Devin), not by socksprox himself. Fixes #2594. ## What and why An allay spawned or placed stood on the ground and fell when the block under it was broken — the reporter watched it drop "as if it wasn't a flying entity". Two pieces were missing versus the 26.3 spec: - **`Allay.travel`**: vanilla calls `travelFlying(input, this.getSpeed())`, a travel with no gravity term at all. Horizon dispatched the allay to the ordinary `travel_in_air`, which subtracts the 0.08 gravity attribute whenever `noGravity` is off — and `noGravity` is only set while a `MoveTo` is active, so an idle allay always sank. `Family::Allay` now has a `custom_travel` arm (`allay::travel`) calling `travelFlying` at the speed its move control set; `travel_flying` is split into `travel_flying_speeds` so the water/lava/air speeds can differ per mob (an allay flies at `LivingEntity.speed`, a ghast at a constant 0.02). - **`WaterAvoidingRandomFlyingGoal.getPosition`**: `Stroll::flying` asked `default_random_pos` for a *land* spot, so a hovering allay never got a stroll target either (the "stood still" half of the report). It now tries `HoverRandomPos.getPos(mob, 8, 7, dir, pi/2, 3, 1)` on the view direction, falling back to `AirAndWaterRandomPos.getPos(mob, 8, 4, -2, dir, pi/2)` — both helpers already existed for other goals. The wither registers the same vanilla goal and gets the same correction for free. ## Vanilla reference - `net.minecraft.world.entity.animal.allay.Allay#travel` → `LivingEntity#travelFlying` - `net.minecraft.world.entity.ai.goal.WaterAvoidingRandomFlyingGoal#getPosition` → `HoverRandomPos`/`AirAndWaterRandomPos` - `net.minecraft.world.entity.ai.control.FlyingMoveControl` (allay: `maxTurn 20`, `hoversInPlace true`) ## Verification - `cargo check -p horizon-client --lib` clean; pr_ready block below. - `tools/test_mob_ai_parity.py --only allay_airborne` (a scenario I added locally, not committed): the probe's allay spawned at y=-55 now stays at -55, `RandomStrollGoal` fires and it drifts to air targets — previously it fell to the ground and stood still. The scenario isn't committed because the probe doesn't model the allay's Brain (`act`/`mem` fields) and the ambient interval is still 120 vs vanilla's 80 — the latter is already covered by open PR #2247, so the trace can't match end-to-end yet. **pr_ready** (`tools/pr_ready.py --quick` on MacBookPro, against origin/main at 783577d2d, 8 min 56 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +57 −5 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 325 passed (27 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (1 s) | | tests: horizon-client | ✅ 1281 passed (7 min 33 s) | | doc tests | ✅ 0 passed (47 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 290 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, breaking_model, cauldron, chunk_generation, command_exec, command_parse and 278 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Devin](https://devin.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:18:21 +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#4594
No description provided.