Login#

Clientbound#

class minecraft.packets.login_clientbound.DisconnectLogin(reason: Chat)#

Sent by the server when the client is disconnected.

Packet ID: 0x00

State: State.LOGIN

Bound to: Client

classmethod from_bytes(data: BytesIO)#

Converts a packet’s data into a packet object.

Parameters:

data (io.BytesIO) – The packet’s data.

Returns:

The packet object.

Return type:

Packet

class minecraft.packets.login_clientbound.EncryptionRequest(server_id: String, public_key: ByteArray, verify_token: ByteArray)#

Sent by the server to request encryption.

Packet ID: 0x01

State: State.LOGIN

Bound to: Client

classmethod from_bytes(data: BytesIO) EncryptionRequest#

Converts a packet’s data into a packet object.

Parameters:

data (io.BytesIO) – The packet’s data.

Returns:

The packet object.

Return type:

Packet

class minecraft.packets.login_clientbound.LoginSuccess(uuid: UUID, username: String, properties: list[minecraft.datatypes.Property])#

Sent by the server to indicate that the client has successfully logged in.

Packet ID: 0x02

State: State.LOGIN

Bound to: Client

classmethod from_bytes(data: BytesIO) LoginSuccess#

Converts a packet’s data into a packet object.

Parameters:

data (io.BytesIO) – The packet’s data.

Returns:

The packet object.

Return type:

Packet

class minecraft.packets.login_clientbound.SetCompression(threshold: Varint)#

Sent by the server to indicate that the client should use compression.

Packet ID: 0x03

State: State.LOGIN

Bound to: Client

classmethod from_bytes(data: BytesIO) SetCompression#

Converts a packet’s data into a packet object.

Parameters:

data (io.BytesIO) – The packet’s data.

Returns:

The packet object.

Return type:

Packet

class minecraft.packets.login_clientbound.LoginPluginRequest(message_id: Varint, channel: String, data: ByteArray)#

Used to implement a custom handshaking flow together with Login Plugin Response. Our client should always respond that it hasn’t understood the request.

Packet ID: 0x04

State: State.LOGIN

Bound to: Client

classmethod from_bytes(data: BytesIO) LoginPluginRequest#

Converts a packet’s data into a packet object.

Parameters:

data (io.BytesIO) – The packet’s data.

Returns:

The packet object.

Return type:

Packet

Serverbound#

class minecraft.packets.login_serverbound.LoginStart(username: String, uuid: UUID | None)#

Sent by the client to start the login process.

Packet ID: 0x00

State: State.LOGIN

Bound to: Server

classmethod from_bytes(data: BytesIO) LoginStart#

Converts a packet’s data into a packet object.

Parameters:

data (io.BytesIO) – The packet’s data.

Returns:

The packet object.

Return type:

Packet

class minecraft.packets.login_serverbound.EncryptionResponse(shared_secret: ByteArray, verify_token: ByteArray)#

Sent by the client to respond to the encryption request.

Packet ID: 0x01

State: State.LOGIN

Bound to: Server

classmethod from_bytes(data: BytesIO) EncryptionResponse#

Converts a packet’s data into a packet object.

Parameters:

data (io.BytesIO) – The packet’s data.

Returns:

The packet object.

Return type:

Packet

class minecraft.packets.login_serverbound.LoginPluginResponse(message_id: Varint, successful: Boolean, data: ByteArray | None = None)#

Sent in response to a plugin message request. Our client should always respond with a successful=False with no further payload.

Packet ID: 0x02

State: State.LOGIN

Bound to: Server

classmethod from_bytes(data: BytesIO) LoginPluginResponse#

Converts a packet’s data into a packet object.

Parameters:

data (io.BytesIO) – The packet’s data.

Returns:

The packet object.

Return type:

Packet