0x02 S02PacketLoginSuccess
Confirms successful authentication. Contains the player's UUID and username. Transitions the connection state from LOGIN to PLAY.
Published 2026-06-18 · Updated 2026-10-14
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
NetHandlerLoginClient.handleLoginSuccess()Handler Interface
INetHandlerLoginClientNotes
Vanilla Source
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
Deobfuscated MCP 1.8.9 source of S02PacketLoginSuccess, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/login/server/S02PacketLoginSuccess.java) at build time and verified present.
Deep Dive
Role in the protocol
The LOGIN-state success packet. NetHandlerLoginServer sends it after encryption and session validation complete: new S02PacketLoginSuccess(this.loginGameProfile), carrying the confirmed UUID and username as two Strings. Vanilla client handling is the state transition itself: NetHandlerLoginClient.handleLoginSuccess stores the GameProfile, calls setConnectionState(EnumConnectionState.PLAY), and installs the NetHandlerPlayClient over the same connection. From this instant the module system's world exists conceptually, but the world itself only materializes on S01PacketJoinGame.
Vanilla handling
handleLoginSuccess is three lines in the 1.8.9 sources: this.field_175091_e = packetIn.func_179730_a(); this.field_147393_d.setConnectionState(EnumConnectionState.PLAY); this.field_147393_d.setNetHandler(new NetHandlerPlayClient(this.field_147394_b, this.field_147395_c, this.field_147393_d, this.field_175091_e));. The gameProfile field is the canonical UUID/name the client uses for the whole session; the session service may return a name different from the one sent in C00PacketLoginStart, and this packet is where the correction lands.
Why clients touch it
The corpus has exactly one non-vanilla reference: Rise 5.99 StaffAlert imports S02PacketLoginSuccess at line 18, and the import is unused (the module's logic touches only S02PacketChat and the Hypixel API). No module in the 8 clients reads the UUID or name from this packet. The structural reason: the packet is consumed by the login handler before any module event bus is live, and clients that need their own UUID or username read them from mc.getSession() or their GameProfile, not from the network. Session-stealing or alt-login features that would care about this packet are absent from the corpus.
Exploit surface
The profile data is server-asserted. An offline-mode server can send any UUID and username it likes, which is the entire basis of name-based alt accounts and cracked-server identity; clients that display 'authenticated' state off this packet would be trivially spoofed. On online-mode servers the values are Mojang-confirmed, so the packet is the client's first trusted identity. No timing or state abuse exists here: the transition to PLAY is instantaneous and any delay would only stall the loading screen.
Server-Side Handling
NetHandlerLoginServer sends S02PacketLoginSuccess after the encryption response validates: the server decrypts the shared secret, verifies the token, joins the session server, then sets its own state to PLAY and sends the packet, optionally preceded by S03PacketEnableCompression when compression is configured. After the send, the server installs its NetHandlerPlayServer. The client treats the packet as authoritative for the session profile.
Protocol Analysis
Wire layout: String UUID (36 chars with dashes), then String username (max 16). Compression, when enabled, is negotiated in LOGIN state before this packet, so the first PLAY packet may already be compressed. Ordering: S02PacketLoginSuccess is the last LOGIN-state packet; the connection then expects S01PacketJoinGame as the first PLAY-state packet. The username here can differ from the login-start name when Mojang renames or corrects it.
Anti-Cheat Landscape
None. The packet precedes world state and carries only identity; anti-cheats are irrelevant to it. The security-relevant property is authentication strength: on online-mode servers the UUID is Mojang-signed, on offline servers it is arbitrary, and plugins that trust UUIDs for permissions inherit that trust boundary. No client module in the corpus touches it.
implementation Implementation Cases
The LOGIN-state success packet that hands the client its confirmed UUID and username and flips the connection to PLAY. Pure vanilla in 7 of 8 clients; the only module hit is an unused import in Rise 5.99 StaffAlert. Nothing in the corpus reads the profile from this packet.
Hypixel staff-ban tracker. Its reference to this packet is an import only; the module does not use S02PacketLoginSuccess.
The corpus hit is line 18, `import net.minecraft.network.login.server.S02PacketLoginSuccess;`. The module's actual logic captures the Hypixel API key from S02PacketChat, sends /api new until the key is set, and polls api.hypixel.net/punishmentstats on a timer thread. The login-success import, like the S01PacketPong, C00Handshake and S40PacketDisconnect imports, is dead.
anticheat Anti-Cheat Checks
The login success packet is another near-empty corpus: only Artemis references it, as packet-library plumbing. PacketRepository maps SERVER_LOGIN + 4 to PacketLoginOutSuccess and GPacketLoginServerSuccess wraps the wire format so login traffic is typed. No anticheat reads the UUID or username, because the packet carries only server-asserted identity and arrives before any check-relevant state exists.
Wraps PacketLoginOutSuccess so Artemis's packet library can read the login-success UUID and username from the wire.
GPacketLoginServerSuccess is linked to the PacketLoginOutSuccess interface and implements ReadableBuffer. Its read method handles both layouts: pre-1.16 reads a 36-char UUID string plus a 16-char name, and 1.16+ reads four ints that are reassembled into a UUID plus the name. The result is stored as a GameProfile.
// ===== FILE: artemisac-artemis-minecraft-anticheat, ac.artemis.packet.spigot/src/main/java/cc/ghast/packet/wrapper/packet/login/GPacketLoginServerSuccess.java =====
package cc.ghast.packet.wrapper.packet.login;
import ac.artemis.packet.protocol.ProtocolVersion;
import ac.artemis.packet.spigot.protocol.PacketLink;
import ac.artemis.packet.spigot.wrappers.GPacket;
import ac.artemis.packet.wrapper.server.PacketLoginOutSuccess;
import cc.ghast.packet.buffer.ProtocolByteBuf;
import cc.ghast.packet.wrapper.mc.GameProfile;
import cc.ghast.packet.wrapper.packet.ReadableBuffer;
import java.util.UUID;
@PacketLink(PacketLoginOutSuccess.class)
public class GPacketLoginServerSuccess extends GPacket implements ReadableBuffer {
public GPacketLoginServerSuccess(UUID player, ProtocolVersion version) {
super("PacketLoginOutServerSuccess", player, version);
}
private GameProfile gameProfile;
@Override
public void read(ProtocolByteBuf byteBuf) {
final UUID uuid;
final String username;
if (version.isOrAbove(ProtocolVersion.V1_16)) {
int[] aint = new int[4];
for(int i = 0; i < aint.length; ++i) {
aint[i] = byteBuf.readInt();
}
uuid = decodeUUID(aint);
username = byteBuf.readStringBuf(16);
} else {
final String uid = byteBuf.readStringBuf(36);
uuid = UUID.fromString(uid);
username = byteBuf.readStringBuf(16);
}
this.gameProfile = new GameProfile(uuid, username);
}
private static UUID decodeUUID(int[] bits) {
return new UUID((long)bits[0] << 32 | (long)bits[1] & 4294967295L, (long)bits[2] << 32 | (long)bits[3] & 4294967295L);
}
public GameProfile getGameProfile() {
return this.gameProfile;
}
}
// NOTE (AI): The wrapper is the only non-vanilla corpus artifact for the login success packet. The PacketRepository mapping sits at SERVER_LOGIN + 4.Related Packets
Wiki Cross-Reference
The username returned here is authoritative and can differ from the name sent in Login Start when accounts are renamed or corrected, so clients should adopt this profile for the session.
MCP 1.8.9 S02PacketLoginSuccess implements Packet
1.8.9 callers: NetHandlerLoginServer.operationComplete sends new S02PacketLoginSuccess (line 128): https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/server/network/NetHandlerLoginServer.java
Cross-checked against minecraft.wiki (CC BY-SA 3.0) for 1.8.9 accuracy.
Vanilla Internals
Full 1.8.9 logic-class sources that send or handle this packet, stored verbatim.