[GH-ISSUE #1602] [server-thread] Client mods never tick, never get their commands and never hear chat in single player #497

Closed
opened 2026-11-02 15:39:32 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @sdraeger on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1602

🤖 Filed by Simon's AI agent (Claude Code), not by Simon himself.

Since single player moved to its server thread (#1514), the window is a client of that server (remote is set), and three of the four client mod hooks are skipped on that path. Code mods only work with --in-frame.

Repro (bundled coords-hud example, main at fe12894, macOS):

horizon-ctl launch --world R --seed 3 --creative --wait --dev-mod target/mods-test/mods/coords_hud.hmod
# type /where in chat
default (server thread) --in-frame
HUD panel (tick hook) never appears shown
/where (mod command) Unknown or incomplete command [Coordinates HUD] 0, 79, 0 in minecraft:overworld
chat hook never called called

Causes

  • Game::tick returns tick_remote() before tick_mods() runs (game.rs, fn tick), so the tick hook never fires.
  • handle_chat_input sends every line to the server when remote is set (game/chat.rs), before run_command → mod_command gets a chance.
  • Server chat arrives through chat_line (game/remote.rs), which never calls mods_chat. Only the in-frame system_message path does.

The frame hook works on both paths.

A PR with the fix follows.

Originally created by @sdraeger on GitHub (Oct 24, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1602 > 🤖 Filed by Simon's AI agent (Claude Code), not by Simon himself. Since single player moved to its server thread (#1514), the window is a client of that server (`remote` is set), and three of the four client mod hooks are skipped on that path. Code mods only work with `--in-frame`. **Repro** (bundled coords-hud example, `main` at fe12894, macOS): ```sh horizon-ctl launch --world R --seed 3 --creative --wait --dev-mod target/mods-test/mods/coords_hud.hmod # type /where in chat ``` | | default (server thread) | `--in-frame` | |---|---|---| | HUD panel (`tick` hook) | never appears | shown | | `/where` (mod command) | `Unknown or incomplete command` | `[Coordinates HUD] 0, 79, 0 in minecraft:overworld` | | `chat` hook | never called | called | **Causes** - `Game::tick` returns `tick_remote()` before `tick_mods()` runs (`game.rs`, `fn tick`), so the `tick` hook never fires. - `handle_chat_input` sends every line to the server when `remote` is set (`game/chat.rs`), before `run_command` → `mod_command` gets a chance. - Server chat arrives through `chat_line` (`game/remote.rs`), which never calls `mods_chat`. Only the in-frame `system_message` path does. The `frame` hook works on both paths. A PR with the fix follows.
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#497
No description provided.