Skip to content

Support despawn-time for entities in weakly loaded chunks, fix potential lag and crash cases #13783

@CatTeaA

Description

@CatTeaA

Is your feature request related to a problem?

A large number of drops, projectiles and entities have accumulated in weakly loaded chunks, causing severe server lag or crashes.

I run a survival server. Most of the time, players don’t mean any harm; they just don’t load those chunks, but this ends up causing the server to reach 1000+ MSPT or Crash.

Image

The image shows 260,000 item drops in a single weakly loaded chunk. Due to the chunk being weakly loaded, the items don't reach the destination fire in time to be destroyed.
https://mclo.gs/x8DEF6W

fix https://mojira.dev/MC-301664

Describe the solution you'd like.

If the entities-spawning-despawn-time provided by Paper works for entities in weakly loaded chunks, it will solve this lag and crash issue.

Describe alternatives you've considered.

null

Other

If implementing this feature would be invasive, perhaps an option could be provided instead.

Entities in weakly loaded chunks do not enter the save phase, so the entity-per-chunk-save-limit option has no effect.

Replace #12986

This lag and crash scenario is quite likely to occur. Water streams and pistons can move drops quickly, and many mobs shoot projectiles. Given sufficient playtime, it can easily happen.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions