This is an unofficial page I made for my own reference when maintaining my Mineflayer plugin


All formatting on this page is stolen from wiki.vg
The Data types table is slightly modified from wiki.vg

Definitions

Data types

Name Size (bytes) Encodes Notes
Boolean 1 Either false or true True is encoded as 0x01, false as 0x00.
Byte 1 An integer between 0 and 255 Unsigned 8-bit integer
Integer 4 An integer between -2147483648 and 2147483647 Signed 32-bit integer, two's complement
Long 8 An integer between -9223372036854775808 and 9223372036854775807 Signed 64-bit integer, two's complement
Float 4 A single-precision 32-bit IEEE 754 floating point number
Double 8 A double-precision 64-bit IEEE 754 floating point number
String(n) ≥ 1
≤ (n×3)+3
A sequence of Unicode Characters UTF-8 string prefixed with its size in bytes as a VarInt. Maximum length of n characters, which varies by context. The encoding used on the wire is regular UTF-8, not Java's "slight modification". However, the length of the string for purposes of the length limit is its number of UTF-16 code units, that is, scalar values > U+FFFF are counted as two. Up to n × 3 bytes can be used to encode a UTF-8 string comprising n code units when converted to UTF-16, and both of those limits are checked. Maximum n value is 32767. The + 3 is due to the max size of a valid length VarInt.
Varint ≥ 1
≤ 5
An integer between -2147483648 and 2147483647 Variable-length data encoding a two's complement signed 32-bit integer
UUID 16 A UUID Encoded as an unsigned 128-bit integer (or two unsigned 64-bit integers: the most significant 64 bits and then the least significant 64 bits)
Byte Array Varies Depends on context This is just a sequence of zero or more bytes, its meaning should be explained somewhere else, e.g. in the packet description. The length must also be known from the context.
Icon 1024 A 16x16 array of Integers representing an icon 16x16 image in RGB
Optional X 0 or size of X A field of type X, or nothing Whether or not the field is present must be known from the context.

Player State

VoiceChat state for a player

Field Name Field Type Notes
Disabled Boolean Whether this player has voice chat disabled
Disconnected Boolean Whether this player is disconnected from Voice Chat
UUID UUID UUID of this Player
Name String Name of this player?
Has Group Boolean Whether this player is in a group
Group Optional UUID UUID of the group this player is in.
Only if Has Group is true

Client Group

Group that the clients can be in

Field Name Field Type Notes
ID UUID UUID of this group
Name String Name of this group
Has Password Boolean Whether this group has a password
Persistent Boolean Whether this group is persistent. (stays open even when empty)
Hidden Boolean Whether this group is hidden. (Invite only)
Type Byte The Type of the group
0 Normal (You can hear nearby players, but they can't hear you)
1 Open (Nearby players can hear you and you can hear them)
2 Closed (You can't hear nearby players and nearby players can't hear you)

Volume Category

Category for the volume menu

Field Name Field Type Notes
ID String Id of this category
Name String Name of this category
Has description Boolean Whether this category has a description
Description Optional String Description for this category
Only if Has description is true
Icon Icon Image for the volume control menu

Packet format

Minecraft Plugin Message

All configuration is done over plugin message channels

Packet ID Bound To Field Name Field Type Notes
0x18 Client Channel Identifier Name of the plugin channel used to send the data.
Data Byte Array (1048576) Any data. The length of this array must be inferred from the packet length.
Packet ID Bound To Field Name Field Type Notes
0x10 Server Channel Identifier Name of the plugin channel used to send the data.
Data Byte Array (1048576) Any data. The length of this array must be inferred from the packet length.

Network Message

All Communication to/from the voice server is done with a Network Message.

Bound To Field Name Field Type Notes
Client Magic Number Byte Currently 255
Payload Length Array VarInt Length of the following array in bytes
Payload Byte Array
Bound To Field Name Field Type Notes
Server Magic Number Byte Currently 255
UUID UUID UUID of player sending this packet
Payload Length Array VarInt Length of the following array in bytes
Payload Byte Array

Configuration

Secret Request

The secret request packet is sent after the player logs / spawns into the server
Channel Bound to Field Name Field Type Notes
voicechat:request_secret Server version Integer Latest version (2.5.5) this is 18

Secret

The secret packet is sent when the client sends a secret request

Channel Bound to Field Name Field Type Notes
voicechat:secret Client Secret UUID Secret for the voice server
Port Integer Port of the voice server
UUID UUID UUID of the player who this secret corresponds to
Codec Byte Represents what codec to use
MTU size Integer Size of largest packet that can be sent
Voicechat Distance Double Distance away a player can be heard
Keep Alive Integer Probably (how long without a recieving a keep alive before timing out)
Groups Enabled Boolean Whether groups are enabled on this server
Voice Host String Where the voice server can be found
Allow Recording Boolean Whether recording is allowed on this server

Add Category

Adds a category to the clients menu

Channel Bound to Field Name Field Type Notes
voicechat:add_category Client Category Volume Category

Add Group

Adds a group to the clients group list

Channel Bound to Field Name Field Type Notes
voicechat:add_group Client Group Client Group

Create Group

Create a group

Channel Bound to Field Name Field Type Notes
voicechat:create_group Server Name String Name of the group
Password String Password for the group
Type Byte The type of the group
0 Normal
1 Open
2 Closed

Joined Group

the response from the server when the client send a Set Group packet

Channel Bound to Field Name Field Type Notes
voicechat:joined_group Client UUID Optional UUID UUID of the group
Wrong Password Boolean Whether the password is wrong

Set Group

Set the group this player is in

Channel Bound to Field Name Field Type Notes
voicechat:set_group Server UUID UUID UUID of the group
Has Password Boolean Whether this packet has a password field
Password String Password for the group. Only if Has Password is true

Leave Group

Leave the Currently active group

Channel Bound to Field Name Field Type Notes
voicechat:leave_group Server

Player State

Set a players Player State

Channel Bound to Field Name Field Type Notes
voicechat:player_state Client Player state Player State The player state for this player

Player States

The states for multiple players

Channel Bound to Field Name Field Type Notes
voicechat:player_states Client Player States Length Array Integer Number of elements in the following array
Player State Player State

Remove category

Removes a volume category from client meny

Channel Bound to Field Name Field Type Notes
voicechat:remove_category Client Id String Id of the category to be removed

Remove group

Removes a group from client menu

Channel Bound to Field Name Field Type Notes
voicechat:remove_group Client UUID UUID UUID of group to be removed

Update State

Update the player voicechat state

Channel Bound to Field Name Field Type Notes
voicechat:update_state Server Disabled Boolean Whether voicechat is disabled

Communication

Mic Packet

Packet Id Bound to Field Name Field Type Notes
1 Server Data Length Array Varint Length of the following array in bytes
Data Byte Array Mic Data
Sequence Number Long Number that ensures packets are played in order
Whispering Boolean Whether the player is Whispering (less range on voice)

Player Sound Packet

Packet Id Bound to Field Name Field Type Notes
2 Client Channel ID UUID UUID of the channel
Sender UUID UUID of the sender
Data Length Array Varint Length of the following array in bytes
Data Byte Array Sound Data
Sequence Number Unsigned Long
Distance Float Distance of the player from the source
Flags Whispering Flags 0x01 Whether this packet is whispered
Has Category 0x02 Whether this packet has a category
Category String Category that this packet is a part of. Only is Has Category (0x02 of flags)

Group Sound Packet

Packet Id Bound to Field Name Field Type Notes
2 Client Channel ID UUID UUID of the channel
Sender UUID UUID of the sender
Data Length Array Varint Length of the following array in bytes
Data Byte Array Sound Data
Sequence Number Unsigned Long
Flags Whispering Flags 0x01 Whether this packet is whispered
Has Category 0x02 Whether this packet has a category
Category String Category that this packet is a part of. Only is Has Category (0x02 of flags)

Location Sound Packet

Packet Id Bound to Field Name Field Type Notes
2 Client Channel ID UUID UUID of the channel
Sender UUID UUID of the sender
Location x Double Origin Location of the sound
y Double
z Double
Data Length Array Varint Length of the following array in bytes
Data Byte Array Sound Data
Sequence Number Unsigned Long
Distance Float Distance of the player from the source
Flags Whispering Flags 0x01 Whether this packet is whispered
Has Category 0x02 Whether this packet has a category
Category String Category that this packet is a part of. Only is Has Category (0x02 of flags)

Authenticate Packet

Packet Id Bound to Field Name Field Type Notes
5 Server Player UUID UUID The UUID of the player attempting to connect
Secret UUID Secret assigned to the player attempting to connect

Authenticate Acknowledgement Packet

Packet Id Bound to
6 Client

Ping Packet

Packet Id Bound to Notes
7 Client and Server

Keep Alive Packet

Packet Id Bound to Notes
8 Client and Server

Connection Check Packet

Packet Id Bound to Notes
9 Server

Connection Check Acknowledgement Packet

Packet Id Bound to Notes
10 Client

Login process

  1. C→S: voicechat:request_secret = Request Secret for UDP server
  2. S→C: voicechat:secret = Secret Response
  3. C→S: Authenticate
  4. S→C: Authenticate Acknowledgement
  5. C→S: Connection Check
  6. S→C: Connection Check Acknowledgement