0x02 S02PacketLoginSuccess

Confirms successful authentication. Contains the player's UUID and username. Transitions the connection state from LOGIN to PLAY.

Clientbound (Server → Client) · LOGIN · net/minecraft/network/login/server/S02PacketLoginSuccess.java

Published 2026-06-18 · Updated 2026-10-14

loginauthenticationplayer
Comprehensive 8/8

Fields

FieldTypeDescription
uuidString (36 chars)Player's UUID in standard format (e.g. '123e4567-e89b-12d3-a456-426614174000')
usernameString (max 16)The player's confirmed username

Wire Encoding

FieldTypeNotes
UUIDStringUUID with dashes
UsernameStringPlayer's Minecraft username

MCP References

MCPNetHandlerLoginClient.handleLoginSuccess()

Handler Interface

HNDINetHandlerLoginClient

Notes

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.

Vanilla Source

S02PacketLoginSuccess.java56 lines · MCP 1.8.9Original ↗
1
package net.minecraft.network.login.server;
2
3
import com.mojang.authlib.GameProfile;
4
import java.io.IOException;
5
import java.util.UUID;
6
import net.minecraft.network.Packet;
7
import net.minecraft.network.PacketBuffer;
8
import net.minecraft.network.login.INetHandlerLoginClient;
9
10
public class S02PacketLoginSuccess implements Packet<INetHandlerLoginClient>
11
{
12
    private GameProfile profile;
13
14
    public S02PacketLoginSuccess()
15
    {
16
    }
17
18
    public S02PacketLoginSuccess(GameProfile profileIn)
19
    {
20
        this.profile = profileIn;
21
    }
22
23
    /**
24
     * Reads the raw packet data from the data stream.
25
     */
26
    public void readPacketData(PacketBuffer buf) throws IOException
27
    {
28
        String s = buf.readStringFromBuffer(36);
29
        String s1 = buf.readStringFromBuffer(16);
30
        UUID uuid = UUID.fromString(s);
31
        this.profile = new GameProfile(uuid, s1);
32
    }
33
34
    /**
35
     * Writes the raw packet data to the data stream.
36
     */
37
    public void writePacketData(PacketBuffer buf) throws IOException
38
    {
39
        UUID uuid = this.profile.getId();
40
        buf.writeString(uuid == null ? "" : uuid.toString());
41
        buf.writeString(this.profile.getName());
42
    }
43
44
    /**
45
     * Passes this Packet on to the NetHandler for processing.
46
     */
47
    public void processPacket(INetHandlerLoginClient handler)
48
    {
49
        handler.handleLoginSuccess(this);
50
    }
51
52
    public GameProfile getProfile()
53
    {
54
        return this.profile;
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.

StaffAlert (Rise 5.99)

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.

Source: Rise 5.99, dev/rise/module/impl/other/StaffAlert.java

Vanilla hook: None for this packet; the module hooks PacketReceiveEvent for S02PacketChat and UpdateEvent for polling.
Irrelevant here: the import is never exercised. A login-success hook would have let the module reset its timer at session start; the author left the import but never wired it.
Variations: No other client has any module reference to S02PacketLoginSuccess; the remaining corpus hits across all 8 clients are vanilla login plumbing.
All 8 clients ship the stock handleLoginSuccess. Rise 6.x and Tenacity rename handler parameters to final; Spicy and Tenacity keep the same three-line body. None of the clients forks the login handler to emit module events.

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.

Login success wrapper (Artemis) (artemisac-artemis-minecraft-anticheat)

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.

Detects: None. This is a typed read of server-asserted identity, not a check. No Artemis check subscribes to the packet.

Source: artemisac-artemis-minecraft-anticheat, ac.artemis.packet.spigot/src/main/java/cc/ghast/packet/wrapper/packet/login/GPacketLoginServerSuccess.java

Variations: The other 49 anticheats never reference the packet. Its only role in the corpus is keeping Artemis's login-state stream typed.

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 dispatching to INetHandlerLoginClient.handleLoginSuccess; wire serde is readPacketData/writePacketData via readStringFromBuffer.

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.