Velocity modern player forwarding protocol information


#1

Some developers have been wondering about official documentation for the Velocity player information forwarding protocol. This thread will cover everything you need to know.

Requesting information

Velocity will send the normal packets to initiate server login: it will send a regular handshake and a start login packet. Once you receive Login Start, you are now expected to send the login plugin request packet next. The channel identifier to use is velocity:player_info, and you do not need to send any information.

The client will send back a login plugin response packet. A normal client will reply that it didn’t understand the message. (Velocity when not configured to use the modern player info forwarding support will also reply in the same way.) Otherwise, Velocity will reply with a payload that can be broken down into the following, which uses native Minecraft data types:

  • HMAC - 32 byte HMAC-SHA256 digest of the remaining part of the message.
  • Protocol Version - A VarInt. This is currently 1.
  • Remote Address - The remote client’s IP address, encoded as a normal Minecraft protocol string.
  • UUID - The player’s UUID, encoded as a 128-bit big endian number (64-bit MSB/LSB).
  • Username - The player’s username, encoded as a normal Minecraft protocol string.
  • Properties: Encoded similarly to the Player List Item’s properties component:
    • Number of properties as VarInt.
    • Property name as a normal Minecraft protocol string.
    • Property value as a normal Minecraft protocol string.
    • A boolean value that indicates whether or not the property has a signature. If so, you should read the following property signature, which is encoded as a normal Minecraft protocol string.

Provided the HMAC is valid and you can read the response, you should be able to log the player in. If not, you should disconnect the connection.