Skip to content

Add isInvalidWorld to AsyncPlayerSpawnLocationEvent#13939

Open
NewwindServer wants to merge 3 commits into
PaperMC:mainfrom
NewwindServer:expand-asyncplayerspawnlocationevent
Open

Add isInvalidWorld to AsyncPlayerSpawnLocationEvent#13939
NewwindServer wants to merge 3 commits into
PaperMC:mainfrom
NewwindServer:expand-asyncplayerspawnlocationevent

Conversation

@NewwindServer
Copy link
Copy Markdown
Contributor

If a world that players are in gets unloaded/reset, they end up spawning in the overworld at the same coordinates they were at.

This can cause players die suffocate in walls or fall to their death

There is no easy way to detect if a player spawn location has had its world changed, this patch fixes that by tracking if the world was determined to be invalid.

I added a constructor overload in-case some plugin author is manually creating AsyncPlayerSpawnLocationEvent instances for some reason.
I also removed boolean[] invalidPlayerWorld = {false}; local variable as it wasn't used for anything, let me know if you want it back.

Also apologies that this isn't in per-file patch format, I could not get it working correctly.

@NewwindServer NewwindServer requested a review from a team as a code owner June 6, 2026 13:26
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Jun 6, 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