[PR #3577] [MERGED] An eye of ender stays in use while the button is held, slowing the player #5066

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3577
Author: @d3grando
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: fix-3505


📝 Commits (1)

  • 46d466f An eye of ender stays in use while the button is held, slowing the player

📊 Changes

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

View changed files

📝 crates/horizon-client/src/game.rs (+3 -1)
📝 crates/horizon-client/src/game/end.rs (+13 -1)
📝 crates/horizon-client/src/game/remote.rs (+11 -2)
📝 tools/agent_control_e2e.py (+22 -8)

📄 Description

🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves.

Fixes #3505

What and why

Right-clicking with an eye of ender in a world (or dimension) with no stronghold did nothing. In vanilla the player goes into item use and is slowed while the button is held. EnderEyeItem.use calls player.startUsingItem(hand) before it searches for a stronghold, and getUseDuration is 0, so LivingEntity.updateUsingItem never counts down to completeUsingItem. The use lasts until the button lets go (releaseUsingItem) or until the hand no longer holds an eye. When a stronghold is found the eye is also thrown, but the player stays in use. So a held button throws one eye, where Horizon threw one every 4 ticks (the right-click repeat), because it never started a use.

Changes:

  • game/end.rs use_ender_eye (server and in-frame): starts the use (self.using) before throw_ender_eye, which still returns without a stronghold. It doesn't start one when an End portal frame is aimed at: use passes there and useOn fills the frame, as before.
  • game.rs tick_used_item: an eye in use is held until released, like a trident. Before, it fell through to the consumable branch and the use ended at once.
  • game/remote.rs (the client of the server thread, LAN or a server): Item.use runs on the client too, so remote_start_held_use starts the eye's use unless a frame is aimed at (new aims_at_end_portal_frame), and held_until_released keeps it until the button lets go. That makes the client send RELEASE_USE_ITEM and apply the use slowdown (LocalPlayer.modifyInput, use_effects speed 0.2).

The use animation is NONE (no consumable component), so there is no arm pose. The visible effects are the slowdown and the single throw.

The item_use_catalog.rs Duration::Constant(0) row was already right. That catalog is only read by its parity probe.

Vanilla reference

  • EnderEyeItem.use: getPlayerPOVHitResult(level, player, Fluid.NONE) on an END_PORTAL_FRAME gives PASS; otherwise player.startUsingItem(hand), then on the server findNearestMapStructure(EYE_OF_ENDER_LOCATED, ..., 100, false). When that is null the result is CONSUME; otherwise it spawns an EyeOfEnder, consumes the eye, and returns SUCCESS_SERVER.
  • EnderEyeItem.getUseDuration: return 0.
  • LivingEntity.updateUsingItem (--useItemRemaining == 0 is never reached from 0), updatingUsingItem (the use stops when the hand's item changes) and Minecraft.handleKeybinds (releaseUsingItem when use is no longer down).

Checked with javap -c -p against the 26.3 client jar.

Tests

The consume scenario of tools/agent_control_e2e.py gets an eye-of-ender case: 3 eyes, right button held for 12 ticks, then released. It asserts the use is on, at most one eye is gone, and the use ends on release. (It also adds mouse to the CLI's positional arguments.) It runs on the default server-thread client in a new world, which has strongholds.

Run on Windows with a small wrapper (junctions instead of os.symlink, no vscreen): agent_control_e2e.py --mode cli --scenario consume --bin-dir <fast build>.

  • before (fix reverted, same build otherwise): [cli] FAIL: AssertionError(None). using is null, and held is null: all 3 eyes were thrown in 12 ticks.
  • after: [cli] PASS in 32 s: {'teleported': [...], 'eye_use_ticks': 16}. The held count is 2.

No Rust unit test covers this: the change lives in Game (bin) methods with no test fixture. Bin tests that still pass: cargo test -p horizon-client --features mods --bin horizon-client -- remote::tests end:: (6 passed).

In-game check

Survival, scratch home, on a platform in the Nether (no stronghold). Driven with horizon-ctl: holding 16 eyes, walk forward 2 s, then walk 2 s again with the right button held.

button up button held using while held eyes left
before (main) 8.63 blocks 8.49 blocks null 16
after, server thread 8.63 blocks 1.70 blocks {"slot":0,"ticks":7} 16
after, --in-frame 8.63 blocks 1.72 blocks {"slot":0,"ticks":8} 16

After the fix, in-frame in the overworld (with a stronghold), holding the button for 20 ticks: using {"slot":0,"ticks":22}, 15 of 16 eyes left (one thrown), and using is null on release.

Self-check

tools/pr_ready.py wasn't run (Windows machine), and neither was tools/port_ledger.py check (its build needs the decompiled sources, which this machine doesn't have). I ran these instead, again after rebasing on the current main:

cargo fmt --all -- --check                                                   # clean
cargo clippy -p horizon-client --features mods --all-targets -- -D warnings  # clean
cargo test -p horizon-client --features mods --bin horizon-client -- remote::tests end::   # 6 passed
python tools/agent_control_e2e.py --mode cli --scenario consume --bin-dir target/fast       # PASS (before: FAIL)

🤖 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/3577 **Author:** [@d3grando](https://github.com/d3grando) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix-3505` --- ### 📝 Commits (1) - [`46d466f`](https://github.com/horizon-rust/horizon/commit/46d466f7c3ed21f06a370026fcc7b2173f0cbc22) An eye of ender stays in use while the button is held, slowing the player ### 📊 Changes **4 files changed** (+49 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+3 -1) 📝 `crates/horizon-client/src/game/end.rs` (+13 -1) 📝 `crates/horizon-client/src/game/remote.rs` (+11 -2) 📝 `tools/agent_control_e2e.py` (+22 -8) </details> ### 📄 Description > 🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves. Fixes #3505 ## What and why Right-clicking with an eye of ender in a world (or dimension) with no stronghold did nothing. In vanilla the player goes into item use and is slowed while the button is held. `EnderEyeItem.use` calls `player.startUsingItem(hand)` before it searches for a stronghold, and `getUseDuration` is 0, so `LivingEntity.updateUsingItem` never counts down to `completeUsingItem`. The use lasts until the button lets go (`releaseUsingItem`) or until the hand no longer holds an eye. When a stronghold is found the eye is also thrown, but the player stays in use. So a held button throws **one** eye, where Horizon threw one every 4 ticks (the right-click repeat), because it never started a use. Changes: - `game/end.rs` `use_ender_eye` (server and in-frame): starts the use (`self.using`) before `throw_ender_eye`, which still returns without a stronghold. It doesn't start one when an End portal frame is aimed at: `use` passes there and `useOn` fills the frame, as before. - `game.rs` `tick_used_item`: an eye in use is held until released, like a trident. Before, it fell through to the consumable branch and the use ended at once. - `game/remote.rs` (the client of the server thread, LAN or a server): `Item.use` runs on the client too, so `remote_start_held_use` starts the eye's use unless a frame is aimed at (new `aims_at_end_portal_frame`), and `held_until_released` keeps it until the button lets go. That makes the client send `RELEASE_USE_ITEM` and apply the use slowdown (`LocalPlayer.modifyInput`, `use_effects` speed 0.2). The use animation is `NONE` (no `consumable` component), so there is no arm pose. The visible effects are the slowdown and the single throw. The `item_use_catalog.rs` `Duration::Constant(0)` row was already right. That catalog is only read by its parity probe. ## Vanilla reference - `EnderEyeItem.use`: `getPlayerPOVHitResult(level, player, Fluid.NONE)` on an `END_PORTAL_FRAME` gives `PASS`; otherwise `player.startUsingItem(hand)`, then on the server `findNearestMapStructure(EYE_OF_ENDER_LOCATED, ..., 100, false)`. When that is null the result is `CONSUME`; otherwise it spawns an `EyeOfEnder`, consumes the eye, and returns `SUCCESS_SERVER`. - `EnderEyeItem.getUseDuration`: `return 0`. - `LivingEntity.updateUsingItem` (`--useItemRemaining == 0` is never reached from 0), `updatingUsingItem` (the use stops when the hand's item changes) and `Minecraft.handleKeybinds` (`releaseUsingItem` when use is no longer down). Checked with `javap -c -p` against the 26.3 client jar. ## Tests The consume scenario of `tools/agent_control_e2e.py` gets an eye-of-ender case: 3 eyes, right button held for 12 ticks, then released. It asserts the use is on, at most one eye is gone, and the use ends on release. (It also adds `mouse` to the CLI's positional arguments.) It runs on the default server-thread client in a new world, which has strongholds. Run on Windows with a small wrapper (junctions instead of `os.symlink`, no vscreen): `agent_control_e2e.py --mode cli --scenario consume --bin-dir <fast build>`. - before (fix reverted, same build otherwise): `[cli] FAIL: AssertionError(None)`. `using` is null, and `held` is null: all 3 eyes were thrown in 12 ticks. - after: `[cli] PASS in 32 s: {'teleported': [...], 'eye_use_ticks': 16}`. The held count is 2. No Rust unit test covers this: the change lives in `Game` (bin) methods with no test fixture. Bin tests that still pass: `cargo test -p horizon-client --features mods --bin horizon-client -- remote::tests end::` (6 passed). ## In-game check Survival, scratch home, on a platform in the Nether (no stronghold). Driven with `horizon-ctl`: holding 16 eyes, walk forward 2 s, then walk 2 s again with the right button held. | | button up | button held | `using` while held | eyes left | |---|---|---|---|---| | before (main) | 8.63 blocks | 8.49 blocks | null | 16 | | after, server thread | 8.63 blocks | **1.70 blocks** | `{"slot":0,"ticks":7}` | 16 | | after, `--in-frame` | 8.63 blocks | **1.72 blocks** | `{"slot":0,"ticks":8}` | 16 | After the fix, in-frame in the overworld (with a stronghold), holding the button for 20 ticks: `using {"slot":0,"ticks":22}`, 15 of 16 eyes left (one thrown), and `using` is null on release. ## Self-check `tools/pr_ready.py` wasn't run (Windows machine), and neither was `tools/port_ledger.py check` (its `build` needs the decompiled sources, which this machine doesn't have). I ran these instead, again after rebasing on the current `main`: ``` cargo fmt --all -- --check # clean cargo clippy -p horizon-client --features mods --all-targets -- -D warnings # clean cargo test -p horizon-client --features mods --bin horizon-client -- remote::tests end:: # 6 passed python tools/agent_control_e2e.py --mode cli --scenario consume --bin-dir target/fast # PASS (before: FAIL) ``` 🤖 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:09:59 +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#5066
No description provided.