[GH-ISSUE #2600] Couldn't interact with command block #653

Closed
opened 2026-11-02 15:40:51 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @duncanfekete on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/2600

When trying to use command block, menu never opened. Maybe missed in AI implementation.

Originally created by @duncanfekete on GitHub (Oct 27, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/2600 When trying to use command block, menu never opened. Maybe missed in AI implementation.
Author
Owner
<!-- gh-comment-id:6431466676 --> @duncanfekete commented on GitHub (Oct 27, 2026): https://github.com/user-attachments/assets/204281d3-397d-4582-ac17-bbf3661cf2d6
Author
Owner

@kacpherek commented on GitHub (Oct 27, 2026):

Thanks duncanfekete for the report! This is fixed by #2498: right clicking a command block now opens its screen in single player (creative with cheats on), and Done saves the command. It's waiting for review.

<!-- gh-comment-id:6434367902 --> @kacpherek commented on GitHub (Oct 27, 2026): Thanks duncanfekete for the report! This is fixed by #2498: right clicking a command block now opens its screen in single player (creative with cheats on), and Done saves the command. It's waiting for review.
Author
Owner

@levzzz5154 commented on GitHub (Oct 27, 2026):

🤖 Agent: fixed in https://github.com/ludovic111/horizon/pull/2607 (fix/command-block-editor).

The cause was where the editor is opened: the command block's screen was
opened only by the level event the window's own server sends
(PlayerEffect::OpenMenu), so a client connected to a server (or a guest
on a host) never reached it and the right-click did nothing. Vanilla opens
the screen on the client that used the block
(Player.openCommandBlock -> LocalPlayer.openCommandBlock ->
CommandBlockEditScreen) and the edit travels to the server as
ServerboundSetCommandBlockPacket, which
ServerGamePacketListenerImpl.handleSetCommandBlock applies when the
player may use game master blocks.

What I verified:

  • net.minecraft.world.level.block.CommandBlock.useWithoutItem in the
    pinned 26.3 jar (the class older versions call CommandBlockBlock)
    requires player.canUseGameMasterBlocks() and then calls
    player.openCommandBlock(commandBlockEntity);
    Player.canUseGameMasterBlocks is
    abilities.instabuild && permissions().hasPermission(Permissions.COMMANDS_GAMEMASTER).
  • The prepared block data gives the command blocks the class chain
    ["CommandBlock", "BaseEntityBlock", "Block"], so the server side of
    the use (horizon-world's use_without_item, the Class::Command arm)
    does reach the menu effect in creative mode with the game master
    permission.
  • On the branch fix/command-block-editor (commit 029deff76, based on
    the current main 37d31da54),
    cargo build -p horizon-client --bin horizon-client is clean (no
    warnings) and cargo fmt -p horizon-client is clean.

This is a port of the open pull request #2498 onto the current main; the
same behaviour (the editor opens, and Done saves the command) is what
#2498 implements.

<!-- gh-comment-id:6434927512 --> @levzzz5154 commented on GitHub (Oct 27, 2026): 🤖 Agent: fixed in https://github.com/ludovic111/horizon/pull/2607 (`fix/command-block-editor`). The cause was where the editor is opened: the command block's screen was opened only by the level event the *window's own* server sends (`PlayerEffect::OpenMenu`), so a client connected to a server (or a guest on a host) never reached it and the right-click did nothing. Vanilla opens the screen on the client that used the block (`Player.openCommandBlock` -> `LocalPlayer.openCommandBlock` -> `CommandBlockEditScreen`) and the edit travels to the server as `ServerboundSetCommandBlockPacket`, which `ServerGamePacketListenerImpl.handleSetCommandBlock` applies when the player may use game master blocks. What I verified: - `net.minecraft.world.level.block.CommandBlock.useWithoutItem` in the pinned 26.3 jar (the class older versions call `CommandBlockBlock`) requires `player.canUseGameMasterBlocks()` and then calls `player.openCommandBlock(commandBlockEntity)`; `Player.canUseGameMasterBlocks` is `abilities.instabuild && permissions().hasPermission(Permissions.COMMANDS_GAMEMASTER)`. - The prepared block data gives the command blocks the class chain `["CommandBlock", "BaseEntityBlock", "Block"]`, so the server side of the use (`horizon-world`'s `use_without_item`, the `Class::Command` arm) does reach the menu effect in creative mode with the game master permission. - On the branch `fix/command-block-editor` (commit `029deff76`, based on the current `main` `37d31da54`), `cargo build -p horizon-client --bin horizon-client` is clean (no warnings) and `cargo fmt -p horizon-client` is clean. This is a port of the open pull request #2498 onto the current `main`; the same behaviour (the editor opens, and Done saves the command) is what #2498 implements.
Author
Owner

@levzzz5154 commented on GitHub (Oct 27, 2026):

🤖 Agent: correction to my comment above — the pull request is
https://github.com/ludovic111/horizon/pull/2694 (not #2607, which I
mistyped). The branch is fix/command-block-editor, the commit
029deff76, based on the current main 37d31da54.

<!-- gh-comment-id:6434930230 --> @levzzz5154 commented on GitHub (Oct 27, 2026): 🤖 Agent: correction to my comment above — the pull request is https://github.com/ludovic111/horizon/pull/2694 (not #2607, which I mistyped). The branch is `fix/command-block-editor`, the commit `029deff76`, based on the current `main` `37d31da54`.
Author
Owner

@socksprox commented on GitHub (Oct 27, 2026):

🤖 Agent: Covered by open PR #2498 (command-block interaction).

<!-- gh-comment-id:6443365233 --> @socksprox commented on GitHub (Oct 27, 2026): 🤖 Agent: Covered by open PR #2498 (command-block interaction).
Author
Owner

@kacpherek commented on GitHub (Oct 27, 2026):

Fixed by #2498: right-clicking a command block opens its screen, and Done saves the command.

<!-- gh-comment-id:6453968956 --> @kacpherek commented on GitHub (Oct 27, 2026): Fixed by #2498: right-clicking a command block opens its screen, and Done saves the command.
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#653
No description provided.