You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This server is running Paper version 1.21.4-222-main@9b1798d (2025-03-27T13:35:40Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
Other
This is a problem because the PlayerChangedWorldEvent is called after the player is respawned, meaning you may receive a wrong value when checking the player's ability to fly
In my specific case, I persist the player's flight state and ability to fly on dimension change to be able to restore those values later when the player enters that specific world again
(basically per world fly state)
The text was updated successfully, but these errors were encountered:
Expected behavior
Abilities shouldn't change
If the player is in survival or adventure mode and are able to fly, that behavior should persist across dimension teleports
Observed/Actual behavior
When teleporting across dimensions, the abilities are reevaluated
For reference
CraftPlayer#teleport
callsPlayerList#respawn
L1511PlayerList#respawn
callsPlayerList#restoreFrom
L2052PlayerList#restoreFrom
callsServerPlayerGameMode#setGameModeForPlayer
L93Steps/models to reproduce
Plugin and Datapack List
plugins: Tweaks
datapacks: [vanilla (built-in)], [file/bukkit (world)], [paper (built-in)]
Paper version
This server is running Paper version 1.21.4-222-main@9b1798d (2025-03-27T13:35:40Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
Other
This is a problem because the PlayerChangedWorldEvent is called after the player is respawned, meaning you may receive a wrong value when checking the player's ability to fly
In my specific case, I persist the player's flight state and ability to fly on dimension change to be able to restore those values later when the player enters that specific world again
(basically per world fly state)
The text was updated successfully, but these errors were encountered: