Skip to content

fix: resync magic block to client after entity-spawn cancel#514

Merged
tastybento merged 1 commit intodevelopfrom
fix/magic-block-client-resync
May 3, 2026
Merged

fix: resync magic block to client after entity-spawn cancel#514
tastybento merged 1 commit intodevelopfrom
fix/magic-block-client-resync

Conversation

@tastybento
Copy link
Copy Markdown
Member

Summary

  • When the magic block rolls a mob, handleEntitySpawn cancels the triggering BlockBreakEvent at EventPriority.HIGHEST. By that point the client has already played the "block disappearing" animation and predicted the block as gone, but the server never sends a corrective block-update packet.
  • Result: the magic block appears transparent client-side until the chunk resyncs (typically on relog), even though the server still has the correct block.
  • Fix: send the actual server-side block state back to the mining player immediately after the cancel, using Player#sendBlockChange.

Test plan

  • Live server: mine the magic block until a mob roll. Block stays visible (no transparent void). Verified end-to-end.
  • Verified server-side state was already correct before the fix (relog confirmed); only the client display was wrong.
  • No-op for non-cancelled paths (EntitySpawnEvent-triggered) and for null-player paths (minion breaks).

🤖 Generated with Claude Code

When a magic-block roll produces a mob, handleEntitySpawn cancels the
triggering BlockBreakEvent at EventPriority.HIGHEST. The client has
already played the "block disappearing" animation by then and predicted
the block as gone, but never receives a corrective block-update packet,
so the magic block appears transparent until the chunk resyncs (e.g. on
relog).

Send a block change to the mining player immediately after the cancel
so the client repaints the actual server-side block state.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 3, 2026

@tastybento tastybento merged commit 77f8d6b into develop May 3, 2026
3 checks passed
@tastybento tastybento deleted the fix/magic-block-client-resync branch May 3, 2026 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant