[GH-ISSUE #4182] Command blocks: two data paths after #3582 and #3748; every client gets the command in chunk data #1232

Closed
opened 2026-11-02 15:45:16 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Username59138 on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4182

Originally assigned to: @Username59138 on GitHub.

🤖 Filed by Username59138's AI agent (Claude Code, Claude Opus 5.5), not by Username59138 personally.

#3582 and #3748 both fixed #3614 (the edit screen forgot the typed command). #3748 was reviewed before #3582 reached main, so main now has both:

#3582 #3748
The server sends the data on open lan_open_command_block: to the opening player only, creative and permission level 2 mark_block_entity_updated in open_menu, plus CommandBlock in lan::chunks::entity_tag
The client refreshes the open screen command_block_data_arrived (reopens the screen) update_command_block_screen (updateGui)

Not vanilla, and a leak. In 26.3 CommandBlockEntity does not override getUpdateTag / getUpdatePacket (checked with javap on the jar): a command block's command is never in chunk data or block updates. Only ServerPlayer.openCommandBlock sends it, to that player (ClientboundBlockEntityDataPacket.create(entity, saveCustomOnly)). entity_tag is also what chunk packets and the block log send, so on main every client near a command block, operator or not, receives its command.

The client also handles each command block data packet twice in remote.rs.

Fix: keep one of each. The opening player's packet stays lan_open_command_block; entity_tag returns nothing for command blocks again; the screen refreshes through one function (the updateGui port from #3748).

Originally created by @Username59138 on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4182 Originally assigned to: @Username59138 on GitHub. > 🤖 Filed by Username59138's AI agent (Claude Code, Claude Opus 5.5), not by Username59138 personally. #3582 and #3748 both fixed #3614 (the edit screen forgot the typed command). #3748 was reviewed before #3582 reached main, so main now has both: | | #3582 | #3748 | |---|---|---| | The server sends the data on open | `lan_open_command_block`: to the opening player only, creative and permission level 2 | `mark_block_entity_updated` in `open_menu`, plus `CommandBlock` in `lan::chunks::entity_tag` | | The client refreshes the open screen | `command_block_data_arrived` (reopens the screen) | `update_command_block_screen` (`updateGui`) | **Not vanilla, and a leak.** In 26.3 `CommandBlockEntity` does not override `getUpdateTag` / `getUpdatePacket` (checked with `javap` on the jar): a command block's command is never in chunk data or block updates. Only `ServerPlayer.openCommandBlock` sends it, to that player (`ClientboundBlockEntityDataPacket.create(entity, saveCustomOnly)`). `entity_tag` is also what chunk packets and the block log send, so on main every client near a command block, operator or not, receives its command. The client also handles each command block data packet twice in `remote.rs`. Fix: keep one of each. The opening player's packet stays `lan_open_command_block`; `entity_tag` returns nothing for command blocks again; the screen refreshes through one function (the `updateGui` port from #3748).
Author
Owner

@Username59138 commented on GitHub (Oct 30, 2026):

/claim

<!-- gh-comment-id:6515187196 --> @Username59138 commented on GitHub (Oct 30, 2026): /claim
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#1232
No description provided.