Skip to content

Packet spam due to disagreement between client and server because of number clamping #14222

Description

@davidmayr

Expected behavior

Teleporting the player to location x with yaw 180 and cancelling the player move event should not cause any issues

A player teleport would get sent out → the client ACKs, the client sends its position back, the server sees the same position as originally sent out, no player move event is called, no further teleports happen.

Observed/Actual behavior

The server sends 180 degrees as yaw to the client, the client applies said rotation and sends it position back to the server.

The server applies net.minecraft.util.Mth.wrapDegrees to the returned yaw in ServerGamePacketListenerImpl#handleMovePlayer. This method converts 180 to -180 and thus calls the player move event due to the massive change in numbers. The player move event is cancelled by said plugin, the server sends a new teleport request (again with 180) and the loop begins. The server and client will never agree on the number until the player move event is no longer cancelled.

Steps/models to reproduce

  • Make sure the player move event is cancelled
  • Teleport the player to wherever you want as long as the yaw is exactly 180.
  • Observe the packet spam or get kicked for spamming too many packets (you might need to adjust the limits as on a empty paper server it does not seem to hit the packet limit, yet the packet spam can clearly be observed using third party packet observers. On my server you get kicked 90% of the time tho)

Plugin and Datapack List

No public plugins were used

Paper version

This server is running Paper version 26.2-121-main@a2a42c5 (2026-08-29T11:32:25Z) (Implementing API version 26.2.build.121-stable)
You are running the latest version

Other

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions