[PR #5695] [MERGED] Endermen riding a boat no longer teleport and play the teleport sound in a loop #6442

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5695
Author: @ASOwnerYT
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/enderman-boat


📝 Commits (1)

  • 10469d5 Endermen riding a boat no longer teleport in a loop

📊 Changes

1 file changed (+64 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/mobs/enderman.rs (+64 -2)

📄 Description

🤖 Opened by asowneryt's AI agent (Claude), not by asowneryt himself.

What and why

An enderman riding a boat (a common enderman-farm setup) kept "teleporting": it played the teleport sound and portal particles over and over, and its held block jittered. Horizon's enderman teleport had no passenger check, so every teleport attempt "succeeded", and then the boat snapped the enderman back to its seat. That happened every tick in rain or water, and again whenever a player stared at it from close up.

The fix, in crates/horizon-client/src/mobs/enderman.rs:

  • teleport_to fails while the enderman is a passenger (vanilla Enderman.teleport(x, y, z) returns false when isPassenger()).
  • The 64-try teleport after a projectile or potion hit returns before any random draw while riding (repeatedlyTryToTeleport). A single teleport() still draws its three values first, as in vanilla.
  • LookForPlayer skips its stare and far-target teleports while riding (EndermanLookForPlayerGoal.tick: !this.enderman.isPassenger()).

Fixes #4865.

Vanilla reference

net.minecraft.world.entity.monster.Enderman: teleport(), teleport(double, double, double), repeatedlyTryToTeleport(), hurtServer, customServerAiStep, EndermanLookForPlayerGoal.tick.

Checked by a new unit test, mobs::enderman::tests::a_seated_enderman_never_teleports:

  • A free enderman teleports; a seated one never does and sends no events.
  • repeatedlyTryToTeleport while seated leaves the RNG untouched; a single teleport() draws exactly nextDouble, nextInt(64), nextDouble.

The test fails without the fix. mob_ai passed (240/240 scenarios), but it has no boat-riding mobs, so it can't cover this case.

Self-check

pr_ready (tools/pr_ready.py --base upstream/main on cachyos, against upstream/main at b6ac0602d, 33 min 52 s)

Check Result
Scope ✅ 1 files, +60 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 511 run, FAILED (failures=2, skipped=1) (30 s)
rustfmt ❌ failed (6 s)
clippy ✅ (1 min 28 s)
tests: horizon-client ✅ 1636 passed (3 min 37 s)
doc tests ✅ 0 passed (1 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ❌ 68 affected, 62 passed, failed: friends_integration, remote_fireball, remote_fireworks, return_to_sender, server_player_sculk (27 min 40 s)

Notes on the red rows:

  • rustfmt: fixed afterwards. cargo fmt --check passes on the pushed commit.
  • Python tests: both failures are test_lab.GameEnvScreenTests.test_macos_and_windows_start_no_virtual_screen. It fails because pr_ready ran under this machine's vscreen run, which sets VSCREEN. No Python is touched here.
  • Parity: all five failures are this machine only. The game panics in the renderer at startup with a wgpu validation error ("Section uploads … Index 220224 extends beyond limit 65536"). return_to_sender and remote_fireball fail the same way with enderman.rs reset to upstream/main.

Suggested label: none (a fix)

🤖 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/5695 **Author:** [@ASOwnerYT](https://github.com/ASOwnerYT) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/enderman-boat` --- ### 📝 Commits (1) - [`10469d5`](https://github.com/horizon-rust/horizon/commit/10469d5c9952018d22b181fd7c6932a18bf90f43) Endermen riding a boat no longer teleport in a loop ### 📊 Changes **1 file changed** (+64 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/enderman.rs` (+64 -2) </details> ### 📄 Description > 🤖 Opened by asowneryt's AI agent (Claude), not by asowneryt himself. ## What and why An enderman riding a boat (a common enderman-farm setup) kept "teleporting": it played the teleport sound and portal particles over and over, and its held block jittered. Horizon's enderman teleport had no passenger check, so every teleport attempt "succeeded", and then the boat snapped the enderman back to its seat. That happened every tick in rain or water, and again whenever a player stared at it from close up. The fix, in `crates/horizon-client/src/mobs/enderman.rs`: - `teleport_to` fails while the enderman is a passenger (vanilla `Enderman.teleport(x, y, z)` returns false when `isPassenger()`). - The 64-try teleport after a projectile or potion hit returns before any random draw while riding (`repeatedlyTryToTeleport`). A single `teleport()` still draws its three values first, as in vanilla. - `LookForPlayer` skips its stare and far-target teleports while riding (`EndermanLookForPlayerGoal.tick`: `!this.enderman.isPassenger()`). Fixes #4865. ## Vanilla reference `net.minecraft.world.entity.monster.Enderman`: `teleport()`, `teleport(double, double, double)`, `repeatedlyTryToTeleport()`, `hurtServer`, `customServerAiStep`, `EndermanLookForPlayerGoal.tick`. Checked by a new unit test, `mobs::enderman::tests::a_seated_enderman_never_teleports`: - A free enderman teleports; a seated one never does and sends no events. - `repeatedlyTryToTeleport` while seated leaves the RNG untouched; a single `teleport()` draws exactly `nextDouble`, `nextInt(64)`, `nextDouble`. The test fails without the fix. `mob_ai` passed (240/240 scenarios), but it has no boat-riding mobs, so it can't cover this case. ## Self-check **pr_ready** (`tools/pr_ready.py --base upstream/main` on cachyos, against upstream/main at b6ac0602d, 33 min 52 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +60 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 511 run, FAILED (failures=2, skipped=1) (30 s) | | rustfmt | ❌ failed (6 s) | | clippy | ✅ (1 min 28 s) | | tests: horizon-client | ✅ 1636 passed (3 min 37 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ❌ 68 affected, 62 passed, failed: friends_integration, remote_fireball, remote_fireworks, return_to_sender, server_player_sculk (27 min 40 s) | Notes on the red rows: - **rustfmt:** fixed afterwards. `cargo fmt --check` passes on the pushed commit. - **Python tests:** both failures are `test_lab.GameEnvScreenTests.test_macos_and_windows_start_no_virtual_screen`. It fails because pr_ready ran under this machine's `vscreen run`, which sets `VSCREEN`. No Python is touched here. - **Parity:** all five failures are this machine only. The game panics in the renderer at startup with a wgpu validation error ("Section uploads … Index 220224 extends beyond limit 65536"). `return_to_sender` and `remote_fireball` fail the same way with `enderman.rs` reset to upstream/main. Suggested label: none (a fix) 🤖 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 06:20:42 +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#6442
No description provided.