0x02 S02PacketLoginSuccess
Confirms successful authentication. Contains the player's UUID and username. Transitions the connection state from LOGIN to PLAY.
Fields
| Field | Type | Description |
|---|---|---|
| uuid | String (36 chars) | Player's UUID in standard format (e.g. '123e4567-e89b-12d3-a456-426614174000') |
| username | String (max 16) | The player's confirmed username |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| UUID | String | UUID with dashes |
| Username | String | Player's Minecraft username |
MCP References
MCP
NetHandlerLoginClient.handleLoginSuccess()Handler Interface
HND
INetHandlerLoginClientNotes
After receiving this, the client connection state transitions to PLAY. The client creates the EntityPlayerSP (local player entity) with the received UUID and username. Compression may be enabled next via S03PacketEnableCompression.
implementation Implementation Cases
SessionStealer
(November 0.2)
Capture login success data (UUID, username) for session management.
if (event.getPacket() instanceof S02PacketLoginSuccess) {
S02PacketLoginSuccess s02 = (S02PacketLoginSuccess) event.getPacket();
// store s02.getProfile().getId() and getName()
}SessionInfo
(November 0.2)
Capture login success data (UUID, username) for session management.
if (event.getPacket() instanceof S02PacketLoginSuccess) {
S02PacketLoginSuccess s02 = (S02PacketLoginSuccess) event.getPacket();
// store s02.getProfile().getId() and getName()
}