[GH-ISSUE #4572] Broken blocks drop items late #1385

Closed
opened 2026-11-02 15:46:33 +07:00 by bsakaguchi · 14 comments
Owner

Originally created by @kira-horizon[bot] on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4572

Version: nightly-2026-10-30-1da354b · OS: Windows 10, i5-2400, GT 1030 (copied from the report)

What I did: Broke a block that dropped an item.
What happened: Noticed a slight drop delay that doesn't match vanilla.
What I expected: No delay, same as vanilla.
Horizon version: nightly-2026-10-30-1da354b
OS, CPU, GPU: Windows 10, i5-2400, GT 1030

Reported on Discord by NativeSync3 in #horizon-bugs · Discord thread
Tags: 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 @kira-horizon[bot] on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4572 **Version:** nightly-2026-10-30-1da354b · **OS:** Windows 10, i5-2400, GT 1030 <sub>(copied from the report)</sub> > What I did: Broke a block that dropped an item. > What happened: Noticed a slight drop delay that doesn't match vanilla. > What I expected: No delay, same as vanilla. > Horizon version: nightly-2026-10-30-1da354b > OS, CPU, GPU: Windows 10, i5-2400, GT 1030 Reported on Discord by **NativeSync3** in #horizon-bugs · [Discord thread](https://discord.com/channels/1559227979002028052/1565793222796513452) Tags: gameplay **Attachments** (Discord links expire after a while; the thread keeps them) - [2026-10-28_02-19-03.mp4](https://cdn.discordapp.com/attachments/1565793222796513452/1565793223786504322/2026-10-28_02-19-03.mp4?ex=6ae63213&is=6ae4e093&hm=889e353dca0c1cdb68b0750c9d379a1d583e9a2e09ca529d3fd06bf0c1cc0e46&) - [2026-10-28_02-19-51.mp4](https://cdn.discordapp.com/attachments/1565793222796513452/1565793224495333386/2026-10-28_02-19-51.mp4?ex=6ae63213&is=6ae4e093&hm=c2d455ca9d51786dcd4afb5c17d5367bb7797f6e8f2a8714a2cbb559117071a9&) <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:46:33 +07:00
Author
Owner

@kira-horizon[bot] commented on GitHub (Oct 30, 2026):

NativeSync3 added on Discord:

Broken blocks drops items late

<!-- gh-comment-id:6530425491 --> @kira-horizon[bot] commented on GitHub (Oct 30, 2026): **NativeSync3** added on Discord: > Broken blocks drops items late <!-- kira -->
Author
Owner

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

🤖 Agent: /claim

<!-- gh-comment-id:6532101015 --> @ludovicthenot commented on GitHub (Oct 30, 2026): 🤖 Agent: /claim
Author
Owner

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

🤖 Agent: Diagnosis, measured on main (6e8e088c2), single player on the server thread, through horizon-ctl (--offscreen), with temporary log lines in the window's predict_break and remote_item_data:

Block broken Window's predicted break (client tick) Drop shown (client tick)
dirt 128 129
oak planks 259 260
sand 344 345

The drop shows one tick (50 ms) after the block goes, every time. What the drop does is vanilla's: pop_position, new_item_motion, the pickup delay, the pairing (AddEntity with its velocity, then the item data) and the drawing from its first frame all match.

Cause: the server thread reads its players' packets only inside its tick. run_integrated_inner runs tick_server, where tick_lan polls the hub, then sleeps in wait_for_next_server_tick (levels.rs) until the next tick. So the window's STOP_DESTROY_BLOCK waits up to a tick before the break, its drops and their pairing happen.

Vanilla handles a packet as soon as it comes in: PacketUtils.ensureRunningOnSameThread queues it on the server's executor, and MinecraftServer.waitUntilNextTick runs those tasks between ticks (managedBlock → pollTask, shouldRun while haveTime()). destroyAndAck then breaks the block, Block.popResource adds the item, and ChunkMap.addEntity pairs it with the players at once (TrackedEntity.updatePlayers), so the drop is on the client the next frame.

What a fix needs: the server thread handling players' packets while it waits between ticks, and sending what they cause (block changes, acks, new entities' pairing) right away, instead of at the next tick_lan. That changes when every player action is applied (breaking, placing, clicks, movement), not only drops, so it is a server-loop decision, and the harnesses that depend on the current order would need a look. Giving the issue back for someone who knows that loop to decide.

<!-- gh-comment-id:6532335813 --> @ludovicthenot commented on GitHub (Oct 30, 2026): 🤖 Agent: Diagnosis, measured on main (6e8e088c2), single player on the server thread, through `horizon-ctl` (`--offscreen`), with temporary log lines in the window's `predict_break` and `remote_item_data`: | Block broken | Window's predicted break (client tick) | Drop shown (client tick) | | --- | --- | --- | | dirt | 128 | 129 | | oak planks | 259 | 260 | | sand | 344 | 345 | The drop shows one tick (50 ms) after the block goes, every time. What the drop does is vanilla's: `pop_position`, `new_item_motion`, the pickup delay, the pairing (`AddEntity` with its velocity, then the item data) and the drawing from its first frame all match. **Cause:** the server thread reads its players' packets only inside its tick. `run_integrated_inner` runs `tick_server`, where `tick_lan` polls the hub, then sleeps in `wait_for_next_server_tick` (levels.rs) until the next tick. So the window's `STOP_DESTROY_BLOCK` waits up to a tick before the break, its drops and their pairing happen. Vanilla handles a packet as soon as it comes in: `PacketUtils.ensureRunningOnSameThread` queues it on the server's executor, and `MinecraftServer.waitUntilNextTick` runs those tasks between ticks (`managedBlock` → `pollTask`, `shouldRun` while `haveTime()`). `destroyAndAck` then breaks the block, `Block.popResource` adds the item, and `ChunkMap.addEntity` pairs it with the players at once (`TrackedEntity.updatePlayers`), so the drop is on the client the next frame. **What a fix needs:** the server thread handling players' packets while it waits between ticks, and sending what they cause (block changes, acks, new entities' pairing) right away, instead of at the next `tick_lan`. That changes when every player action is applied (breaking, placing, clicks, movement), not only drops, so it is a server-loop decision, and the harnesses that depend on the current order would need a look. Giving the issue back for someone who knows that loop to decide.
Author
Owner

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

🤖 Agent: /unclaim

<!-- gh-comment-id:6532336142 --> @ludovicthenot commented on GitHub (Oct 30, 2026): 🤖 Agent: /unclaim
Author
Owner

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

🤖 Agent: /claim

<!-- gh-comment-id:6533487033 --> @WooCaash commented on GitHub (Oct 30, 2026): 🤖 Agent: /claim
Author
Owner

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

🤖 Agent: /unclaim

<!-- gh-comment-id:6533623007 --> @WooCaash commented on GitHub (Oct 30, 2026): 🤖 Agent: /unclaim
Author
Owner

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

/unclaim

<!-- gh-comment-id:6533651513 --> @WooCaash commented on GitHub (Oct 30, 2026): /unclaim
Author
Owner

@github-actions[bot] commented on GitHub (Oct 30, 2026):

🤖 Claims: refused, You don't hold this issue. (asked by @WooCaash)

<!-- gh-comment-id:6533722344 --> @github-actions[bot] commented on GitHub (Oct 30, 2026): 🤖 Claims: refused, You don't hold this issue. (asked by @WooCaash)
Author
Owner

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

🤖 Agent: /unclaim

<!-- gh-comment-id:6533770505 --> @WooCaash commented on GitHub (Oct 30, 2026): 🤖 Agent: /unclaim
Author
Owner

@github-actions[bot] commented on GitHub (Oct 30, 2026):

🤖 Claims: refused, You don't hold this issue. (asked by @WooCaash)

<!-- gh-comment-id:6533773253 --> @github-actions[bot] commented on GitHub (Oct 30, 2026): 🤖 Claims: refused, You don't hold this issue. (asked by @WooCaash)
Author
Owner

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

🤖 Agent: /claim

<!-- gh-comment-id:6533831906 --> @WooCaash commented on GitHub (Oct 30, 2026): 🤖 Agent: /claim
Author
Owner

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

🤖 Agent: Prior diagnosis stands — the 1-tick drop lag is from the server thread only reading player packets inside tick_lan, not between ticks like vanilla's pollTask/haveTime(). Fixing that is a server-loop change (all player actions), not a drop-only patch. /unclaim so someone owning that loop can take it.

<!-- gh-comment-id:6534106810 --> @WooCaash commented on GitHub (Oct 30, 2026): 🤖 Agent: Prior diagnosis stands — the 1-tick drop lag is from the server thread only reading player packets inside `tick_lan`, not between ticks like vanilla's `pollTask`/`haveTime()`. Fixing that is a server-loop change (all player actions), not a drop-only patch. `/unclaim` so someone owning that loop can take it.
Author
Owner

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

/unclaim

<!-- gh-comment-id:6534107164 --> @WooCaash commented on GitHub (Oct 30, 2026): /unclaim
Author
Owner

@kira-horizon[bot] commented on GitHub (Oct 31, 2026):

NativeSync3 added on Discord:

Have you checked both videos?

<!-- gh-comment-id:6550201238 --> @kira-horizon[bot] commented on GitHub (Oct 31, 2026): **NativeSync3** added on Discord: > Have you checked both videos? <!-- kira -->
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#1385
No description provided.