Skip to content

Listen to respawn packets with PacketEvents - #251

Merged
turikhay merged 22 commits into
mainfrom
packet-events
May 21, 2026
Merged

turikhay merged 22 commits into
mainfrom
packet-events

Conversation

@turikhay

@turikhay turikhay commented May 21, 2026 •

Copy link
Copy Markdown
Owner

Fixes #224

Due to Folia's multi-threaded architecture, generic teleport events are almost never fired. To detect players changing dimensions, we use PlayerChangedWorldEvent, but in Folia that event only fires after death.

As a fallback, we listen for the Respawn packet (0x50). It is a reliable way to detect players teleporting between worlds.

This implementation uses the PacketEvents library for packet handling. While ProtocolLib is still recommended for older versions (see #8), it is less well-suited for Folia due to its uneven release cadence. ProtocolLib support for this specific use case may be added in the future if there is demand.

▶️ Download PacketEvents here

@turikhay
turikhay marked this pull request as ready for review May 21, 2026 14:32
@turikhay
turikhay merged commit c7d3152 into main May 21, 2026
17 of 18 checks passed
@turikhay
turikhay deleted the packet-events branch May 21, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Xaero will lose track of the map after crossing dimensions on Folia

1 participant