Skip to content

feat: skip large block entities#14091

Open
RedVortexDev wants to merge 2 commits into
PaperMC:mainfrom
RedVortexDev:feat/skip-large-block-entities
Open

feat: skip large block entities#14091
RedVortexDev wants to merge 2 commits into
PaperMC:mainfrom
RedVortexDev:feat/skip-large-block-entities

Conversation

@RedVortexDev

Copy link
Copy Markdown
Contributor

This pull request changes how chunk packets are constructed to send separate Block Entity Update packets based on the block entity's size, and not just on how many block entities are in the chunk.

Each block entity is serialized once to not add overhead for checking the data size:

  • If it's not too big or hasn't exceeded the block entity limit per chunk, it's added to the regular block entity data list directly.
  • If it is, it's re-serialized as a packet to be sent separately alongside the chunk packet

The client-bound block entity data packet now also has a fallback for when it's too large to be sent, to prevent being kicked.

  • A new AsyncBlockEntityUpdateTooLargeEvent is fired
  • The block entity update is ignored

I was not able to perceive any performance loss for normal or large block entities when profiling, however there is a theoretical tradeoff where large block entities would be serialized twice, this should not matter in most cases

@RedVortexDev
RedVortexDev requested a review from a team as a code owner July 22, 2026 13:33
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

1 participant