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
{{ message }}
Repository navigation
PlayerList#respawn reuses ServerPlayer without resetting sprinting state or SPEED_MODIFIER_SPRINTING #14413
When a player respawns or changes dimensions through PlayerList#respawn, player.isSprinting() should be false and Attributes.MOVEMENT_SPEED should not retain LivingEntity.SPEED_MODIFIER_SPRINTING, matching vanilla behavior where PlayerList#respawn constructs a new ServerPlayer instance.
Observed/Actual behavior
Because Paper reuses the existing ServerPlayer instance in PlayerList#respawn (ServerPlayer player = serverPlayer; // Paper - TODO - recreate instance), it manually resets sneaking via player.setShiftKeyDown(false), but never calls player.setSprinting(false) in PlayerList#respawn or ServerPlayer#reset.
In addition, ServerGamePacketListenerImpl#handlePlayerCommand ignores STOP_SPRINTING packets while !this.hasClientLoaded(). If a player dies or enters a portal while sprinting, player.isSprinting() remains true and SPEED_MODIFIER_SPRINTING (+30% movement speed) stays attached to Attributes.MOVEMENT_SPEED in sendAllPlayerInfo after respawn or dimension change.
Steps/models to reproduce
Join a Paper server and start sprinting.
While sprinting, die and respawn (or enter a Nether/End portal).
Inspect player.isSprinting() and player.getAttribute(Attribute.MOVEMENT_SPEED).getModifiers() in PlayerRespawnEvent / PlayerPostRespawnEvent (or in the ClientboundUpdateAttributesPacket sent by PlayerList#sendAllPlayerInfo).
Observe that isSprinting() is still true and minecraft:sprinting (0.3ADD_MULTIPLIED_TOTAL) is still present on the respawned player until a new STOP_SPRINTING packet is received after ServerboundPlayerLoadedPacket.
Plugin and Datapack List
None
Paper version
This server is running Paper version 1.21.11-R0.1-SNAPSHOT (MC: 1.21.11 / 26.3)
Other
In paper-server/patches/sources/net/minecraft/server/players/PlayerList.java.patch, right next to:
player.setShiftKeyDown(false);
calling:
player.setSprinting(false);
clears both the shared sprinting flag (setSharedFlag(3, false)) and SPEED_MODIFIER_SPRINTING on the reused ServerPlayer.
Activity