[GH-ISSUE #1768] Ghost blocks/items appear in the inventory crafting grid when exiting a crafting table #539

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

Originally created by @ludovic111 on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1768

What i did: The video shows exactly how the bug happens.

What happened: A bunch of ghost blocks appeared in the inventory crafting grid once i c​losed a crafting table that still contained 6 cobblestone blocks inside of it, it appears to be just a visual bug though, picking them up does nothing and the items/blocks disappear after that.

What I expected: To find nothing inside the crafting grid.

Horizon version: 0.2.53

OS, CPU, GPU: Windows 11 x64, AMD Ryzen 5700X, RTX 2080TI (11gb)

Reported on Discord by EMIL in #horizon-bugs · Discord thread
Tags: rendering, gameplay

Attachments (Discord links expire after a while; the thread keeps them)

Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.

Originally created by @ludovic111 on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1768 > What i did: The video shows exactly how the bug happens. > > What happened: A bunch of ghost blocks appeared in the inventory crafting grid once i c​losed a crafting table that still contained 6 cobblestone blocks inside of it, it appears to be just a visual bug though, picking them up does nothing and the items/blocks disappear after that. > > What I expected: To find nothing inside the crafting grid. > > Horizon version: 0.2.53 > > OS, CPU, GPU: Windows 11 x64, AMD Ryzen 5700X, RTX 2080TI (11gb) Reported on Discord by **EMIL** in #horizon-bugs · [Discord thread](https://discord.com/channels/1559227979002028052/1563835639655432234) Tags: rendering, gameplay **Attachments** (Discord links expire after a while; the thread keeps them) - [2026-10-25_09-14-48.mp4](https://cdn.discordapp.com/attachments/1563835639655432234/1563835640611606568/2026-10-25_09-14-48.mp4?ex=6adf12ef&is=6addc16f&hm=b37b802a93d1fda650cd0a61d9a499f9e7681fdb0abac0c4246b67492363fa6a&) <sub>Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.</sub><!-- kira -->
bsakaguchi 2026-11-02 15:39:52 +07:00
Author
Owner

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

🤖 Agent: could not reproduce on main (8cf51888). In game: open a crafting table, Shift+Left-Click a stack of 6 cobblestone into the grid, close with Escape, reopen the inventory — the grid comes back empty and the 6 cobblestone are back in the inventory (counts reports 6, no ghost entries), and the plain inventory grid draws nothing.

That matches close_container returning carried and every craft_grid slot through Game::give before clearing them (game.rs), so the ghost in the video may need a specific close path. If it still happens on 0.2.66, which way did you close the table (Escape, E, or clicking outside) and was the 2x2 grid also holding something?

<!-- gh-comment-id:6411278485 --> @levzzz5154 commented on GitHub (Oct 26, 2026): 🤖 Agent: could not reproduce on `main` (8cf51888). In game: open a crafting table, Shift+Left-Click a stack of 6 cobblestone into the grid, close with Escape, reopen the inventory — the grid comes back empty and the 6 cobblestone are back in the inventory (`counts` reports 6, no ghost entries), and the plain inventory grid draws nothing. That matches `close_container` returning `carried` and every `craft_grid` slot through `Game::give` before clearing them (`game.rs`), so the ghost in the video may need a specific close path. If it still happens on 0.2.66, which way did you close the table (Escape, `E`, or clicking outside) and was the 2x2 grid also holding something?
Author
Owner

@rdbtCVS commented on GitHub (Oct 26, 2026):

🤖 Agent: rdbtCVS’s AI agent (OpenAI Codex), triage follow-up. Merged PR #1795 clears the remote client's stale crafting grid/carried stack when a menu closes. Recommend closing as fixed unless this still reproduces on a build containing that change.

<!-- gh-comment-id:6418462135 --> @rdbtCVS commented on GitHub (Oct 26, 2026): 🤖 Agent: rdbtCVS’s AI agent (OpenAI Codex), triage follow-up. Merged PR #1795 clears the remote client's stale crafting grid/carried stack when a menu closes. Recommend closing as fixed unless this still reproduces on a build containing that change.
Author
Owner

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

Fixed on main by #1795 (stale crafting grid and carried stack are cleared when a remote menu closes).

<!-- gh-comment-id:6422491542 --> @kacpherek commented on GitHub (Oct 26, 2026): Fixed on main by #1795 (stale crafting grid and carried stack are cleared when a remote menu closes).
Author
Owner

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

🤖 Agent: this is fixed on main, and I verified both halves of it.

The remote half is #1795 ("Drop the stale craft grid when a remote menu closes", commit 87b3c9aa, merged in e99414e9): Game::remote_close_local now clears the client's copies when the server's menu closes — self.craft_grid.fill(None), self.carried = None and self.craft_size = 2 — which is AbstractContainerMenu.removed (the server gives the grid and the carried stack back and syncs them; the client's copies are stale the moment the window closes).

The local half never had the ghost: Game::close_container returns the carried stack and every craft_grid slot to the player through Game::give (and drops what does not fit, as AbstractContainerMenu.dropOrPlaceInInventory does) and clears the slots, so the 2x2 grid that comes back is empty.

Vanilla reference: net.minecraft.world.inventory.AbstractContainerMenu.removed / clearContainer (the inputs go back to the player) and net.minecraft.client.gui.screens.inventory.CreativeModeInventoryScreen (the 2x2 grid belongs to the player's own InventoryMenu).

I could not reproduce the ghost on main (the report is from 0.2.53), so I am leaving this open rather than closing it: if it still happens on a build that has #1795, the way the table was closed (Escape, E, or walking away) and whether the game was on a server would narrow it down.

<!-- gh-comment-id:6429474992 --> @levzzz5154 commented on GitHub (Oct 26, 2026): 🤖 Agent: this is fixed on `main`, and I verified both halves of it. The remote half is #1795 ("Drop the stale craft grid when a remote menu closes", commit `87b3c9aa`, merged in `e99414e9`): `Game::remote_close_local` now clears the client's copies when the server's menu closes — `self.craft_grid.fill(None)`, `self.carried = None` and `self.craft_size = 2` — which is `AbstractContainerMenu.removed` (the server gives the grid and the carried stack back and syncs them; the client's copies are stale the moment the window closes). The local half never had the ghost: `Game::close_container` returns the carried stack and every `craft_grid` slot to the player through `Game::give` (and drops what does not fit, as `AbstractContainerMenu.dropOrPlaceInInventory` does) and clears the slots, so the 2x2 grid that comes back is empty. Vanilla reference: `net.minecraft.world.inventory.AbstractContainerMenu.removed` / `clearContainer` (the inputs go back to the player) and `net.minecraft.client.gui.screens.inventory.CreativeModeInventoryScreen` (the 2x2 grid belongs to the player's own `InventoryMenu`). I could not reproduce the ghost on `main` (the report is from 0.2.53), so I am leaving this open rather than closing it: if it still happens on a build that has #1795, the way the table was closed (Escape, `E`, or walking away) and whether the game was on a server would narrow it down.
Author
Owner

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

🤖 Agent: Verified fixed on current main — this was 87b3c9aa3 ("Drop the stale craft grid when a remote menu closes"), shipped in v0.2.58; the report was on v0.2.53. I reproduced the exact scenario in-game (survival, 6 cobblestone left in a crafting table, close, open inventory): the 2×2 grid is empty and all 64 blocks are back in the hotbar, no ghosts. Suggest closing.

<!-- gh-comment-id:6441516175 --> @socksprox commented on GitHub (Oct 27, 2026): 🤖 Agent: Verified fixed on current main — this was `87b3c9aa3` ("Drop the stale craft grid when a remote menu closes"), shipped in v0.2.58; the report was on v0.2.53. I reproduced the exact scenario in-game (survival, 6 cobblestone left in a crafting table, close, open inventory): the 2×2 grid is empty and all 64 blocks are back in the hotbar, no ghosts. Suggest closing.
Author
Owner

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

Fixed by #1795: the stale crafting grid is cleared when a server menu closes.

<!-- gh-comment-id:6453960690 --> @kacpherek commented on GitHub (Oct 27, 2026): Fixed by #1795: the stale crafting grid is cleared when a server menu closes.
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#539
No description provided.