[GH-ISSUE #3205] /dialog show and /dialog clear report success but never send the dialog #874

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

Originally created by @masa-masa-0314 on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3205

🤖 Opened by masa-masa-0314's AI agent (ZCode), not by masa-masa-0314 personally.

What happens

/dialog show and /dialog clear report success but no dialog ever opens: the hosted game records the command's dialog state and prints the feedback line, and nothing sends ClientboundShowDialogPacket / ClientboundClearDialogPacket.

Reproduction

In a single-player world:

/dialog show @s {type:"minecraft:notice",title:"Hi",body:[{type:"minecraft:plain_message",contents:"Body"}]}
  • Horizon: chat says Displayed dialog to <name>, the screen stays playing, and horizon-ctl state reports "dialog": {"open": null, "screen": null}. /dialog clear likewise does nothing.
  • Vanilla 26.3: the notice dialog opens with its OK button.

This is the same on a LAN world (guests receive nothing) and on a dedicated server, because none of them have a sending side.

Vanilla reference

  • net.minecraft.server.dialog.DialogCommand → ServerPlayer.openDialog(Holder<Dialog>) → connection.send(new ClientboundShowDialogPacket(holder)).
  • ServerPlayer.closeDialog() → ClientboundClearDialogPacket.
  • The packet carries either a minecraft:dialog registry holder or the dialog itself (Horizon's DialogHolder/show_play_dialog already read both).

Where it stops in Horizon

  • crates/horizon-client/src/game/commands/extra.rs — cmd_dialog (dialog.show/dialog.clear) calls open_dialog / close_dialog, which only set and clear CommandExtras.dialog (self.cmds.dialog, lines 1044–1051), and then send the feedback message.
  • That field is never read: a workspace-wide search for cmds.dialog finds the two writes and nothing else, and no code constructs play::Clientbound::ShowDialog or ClearDialog (only the protocol definitions, the receive path in game/remote.rs:2968, and the configuration-phase receive path in net.rs).

So the client half is done — show_play_dialog, clear_dialog, the dialog screen, inputs and actions all exist — and only the hosted server's send is missing.

Suggested fix

Send the packet where the command runs, the way other command output reaches players (host.hub.send_to(conn, &packet), as /title in game/commands/text_commands.rs and /kick in game/commands/players.rs do): resolve a registry id against the minecraft:dialog registry (inline SNBT goes as-is), and send ClearDialog for /dialog clear. Side note: the minecraft:dialog registry is datapack-only in vanilla, so an id form of the command can only ever resolve when the world supplies one — the inline form above is the one to test with.

Originally created by @masa-masa-0314 on GitHub (Oct 28, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3205 > 🤖 Opened by masa-masa-0314's AI agent (ZCode), not by masa-masa-0314 personally. ## What happens `/dialog show` and `/dialog clear` report success but no dialog ever opens: the hosted game records the command's dialog state and prints the feedback line, and nothing sends `ClientboundShowDialogPacket` / `ClientboundClearDialogPacket`. ## Reproduction In a single-player world: ``` /dialog show @s {type:"minecraft:notice",title:"Hi",body:[{type:"minecraft:plain_message",contents:"Body"}]} ``` - **Horizon:** chat says `Displayed dialog to <name>`, the screen stays `playing`, and `horizon-ctl state` reports `"dialog": {"open": null, "screen": null}`. `/dialog clear` likewise does nothing. - **Vanilla 26.3:** the notice dialog opens with its OK button. This is the same on a LAN world (guests receive nothing) and on a dedicated server, because none of them have a sending side. ## Vanilla reference - `net.minecraft.server.dialog.DialogCommand` → `ServerPlayer.openDialog(Holder<Dialog>)` → `connection.send(new ClientboundShowDialogPacket(holder))`. - `ServerPlayer.closeDialog()` → `ClientboundClearDialogPacket`. - The packet carries either a `minecraft:dialog` registry holder or the dialog itself (Horizon's `DialogHolder`/`show_play_dialog` already read both). ## Where it stops in Horizon - `crates/horizon-client/src/game/commands/extra.rs` — `cmd_dialog` (`dialog.show`/`dialog.clear`) calls `open_dialog` / `close_dialog`, which only set and clear `CommandExtras.dialog` (`self.cmds.dialog`, lines 1044–1051), and then send the feedback message. - That field is never read: a workspace-wide search for `cmds.dialog` finds the two writes and nothing else, and no code constructs `play::Clientbound::ShowDialog` or `ClearDialog` (only the protocol definitions, the receive path in `game/remote.rs:2968`, and the configuration-phase receive path in `net.rs`). So the client half is done — `show_play_dialog`, `clear_dialog`, the dialog screen, inputs and actions all exist — and only the hosted server's send is missing. ## Suggested fix Send the packet where the command runs, the way other command output reaches players (`host.hub.send_to(conn, &packet)`, as `/title` in `game/commands/text_commands.rs` and `/kick` in `game/commands/players.rs` do): resolve a registry id against the `minecraft:dialog` registry (inline SNBT goes as-is), and send `ClearDialog` for `/dialog clear`. Side note: the `minecraft:dialog` registry is datapack-only in vanilla, so an id form of the command can only ever resolve when the world supplies one — the inline form above is the one to test with.
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#874
No description provided.