[PR #3632] [MERGED] horizon-ctl drop: let the server throw the stack on a client of a server #5106

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3632
Author: @SU4G3
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix/horizon-ctl-drop-remote


📝 Commits (1)

  • 2445108 horizon-ctl drop: let the server throw the stack on a client of a server

📊 Changes

3 files changed (+19 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/agent.rs (+9 -1)
📝 crates/horizon-client/src/game/remote.rs (+1 -1)
📝 tools/agent_control_e2e.py (+9 -0)

📄 Description

Related: #3523 (the same bug on the creative screen, fixed by #3149).

What

horizon-ctl drop (and the MCP drop tool) now lets the server throw the stack when the window is a client of a server: on multiplayer servers and in single player on its server thread (the default).

Why

drop in game/agent.rs called drop_held on the window's own Game with no remote branch. On a client of a server that spawns a client-only item entity and never tells the server, so the server keeps the items: the client shows the stack one smaller while the server still counts it. The Q key already goes through remote_drop (MultiPlayerGameMode-style: predict the removal, send PlayerAction DROP_ITEM / DROP_ALL_ITEMS). drop now does the same, and does nothing in spectator mode, as Q does.

Verification

Offscreen, server thread, fresh mktemp -d homes, --profile fast: give 5 diamonds, horizon-ctl drop, then ask the server (clear @s minecraft:diamond 0):

| Build | drop reply (client) | Server's count |
| this branch | held 5 → 4 | Found 4 |

tools/agent_control_e2e.py's survival scenario gets a step 6 that drops a plank and asks the server how many are left (a check of the client's own inventory or entities passes on main too). Run on Linux with --mode cli --scenario survival (launched offscreen; this machine's windowed run stops at the title menu before reaching it):

Build Step 6
main ❌ Found 3 matching item(s) after dropping one of 3 planks
this branch ✅ Found 2 matching item(s), scenario passes in 11 s

pr_ready (tools/pr_ready.py --quick on fedora, against origin/main at 0b74b68aa, 10 min 55 s)

Check Result
Scope ✅ 10 files, +49 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 408 passed (36 s)
rustfmt ✅ (7 s)
clippy ✅ (3 min 7 s)
tests: horizon-client ✅ 799 passed (5 min 46 s)
doc tests ✅ 0 passed (1 min 19 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 ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

pr_ready's Scope row counts untracked local game files in my checkout; the commit itself is 3 files, +19 −2.


🔄 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/3632 **Author:** [@SU4G3](https://github.com/SU4G3) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/horizon-ctl-drop-remote` --- ### 📝 Commits (1) - [`2445108`](https://github.com/horizon-rust/horizon/commit/2445108f1057f672de9c0af7e4f8a0cba300ebdd) horizon-ctl drop: let the server throw the stack on a client of a server ### 📊 Changes **3 files changed** (+19 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/agent.rs` (+9 -1) 📝 `crates/horizon-client/src/game/remote.rs` (+1 -1) 📝 `tools/agent_control_e2e.py` (+9 -0) </details> ### 📄 Description Related: #3523 (the same bug on the creative screen, fixed by #3149). ## What `horizon-ctl drop` (and the MCP `drop` tool) now lets the server throw the stack when the window is a client of a server: on multiplayer servers and in single player on its server thread (the default). ## Why `drop` in `game/agent.rs` called `drop_held` on the window's own `Game` with no `remote` branch. On a client of a server that spawns a client-only item entity and never tells the server, so the server keeps the items: the client shows the stack one smaller while the server still counts it. The Q key already goes through `remote_drop` (`MultiPlayerGameMode`-style: predict the removal, send `PlayerAction` DROP_ITEM / DROP_ALL_ITEMS). `drop` now does the same, and does nothing in spectator mode, as Q does. ## Verification Offscreen, server thread, fresh `mktemp -d` homes, `--profile fast`: give 5 diamonds, `horizon-ctl drop`, then ask the server (`clear @s minecraft:diamond 0`): | Build | `drop` reply (client) | Server's count | | this branch | held 5 → 4 | **Found 4** | `tools/agent_control_e2e.py`'s survival scenario gets a step 6 that drops a plank and asks the server how many are left (a check of the client's own inventory or entities passes on main too). Run on Linux with `--mode cli --scenario survival` (launched offscreen; this machine's windowed run stops at the title menu before reaching it): | Build | Step 6 | |---|---| | main | ❌ `Found 3 matching item(s)` after dropping one of 3 planks | | this branch | ✅ `Found 2 matching item(s)`, scenario passes in 11 s | **pr_ready** (`tools/pr_ready.py --quick` on fedora, against origin/main at 0b74b68aa, 10 min 55 s) | Check | Result | | --- | --- | | Scope | ✅ 10 files, +49 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 408 passed (36 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (3 min 7 s) | | tests: horizon-client | ✅ 799 passed (5 min 46 s) | | doc tests | ✅ 0 passed (1 min 19 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 | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | pr_ready's Scope row counts untracked local game files in my checkout; the commit itself is 3 files, +19 −2. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:10:17 +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#5106
No description provided.