0x01 S01PacketJoinGame

Welcomes the player into the world. Sends entity ID, gamemode, dimension, difficulty, max players, world type, and reduced debug info.

Clientbound (Server → Client) · PLAY · net/minecraft/network/play/server/S01PacketJoinGame.java

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

playerworldspawn
Comprehensive 8/8

Fields

FieldTypeDescription
entityIdintThe player's own entity ID
gamemodeunsigned byte0=survival, 1=creative, 2=adventure, 3=spectator
dimensionbyte-1=nether, 0=overworld, 1=end
difficultyunsigned byteServer difficulty (0-3)
maxPlayersunsigned byteMax players (used to draw tab player list)
worldTypeString'default', 'flat', 'largeBiomes', 'amplified', 'customized'
reducedDebugInfobooleanWhether to hide coordinates in F3 debug screen

Wire Encoding

FieldTypeNotes
Entity IDintPlayer's own entity ID on the server
Gamemodeunsigned byte0=survival, 1=creative, 2=adventure, 3=spectator
Dimensionbyte-1=nether, 0=overworld, 1=end
Difficultyunsigned byte0=peaceful, 1=easy, 2=normal, 3=hard
Max Playersunsigned byteUsed for tab list rendering
Level TypeString'default', 'flat', 'largeBiomes', 'amplified', 'customized'
Reduced Debug InfobooleanIf true, hides coords from F3

MCP References

MCPNetHandlerPlayClient.handleJoinGame()

Handler Interface

HNDINetHandlerPlayClient

Notes

This is the VERY FIRST PLAY-state packet the client receives after login. It creates the WorldClient and EntityPlayerSP. All modules that depend on mc.theWorld or mc.thePlayer being non-null must wait for this packet. It's the universal 'onWorldLoad' trigger.

Vanilla Source

S01PacketJoinGame.java129 lines · MCP 1.8.9Original ↗
1
package net.minecraft.network.play.server;
2
3
import java.io.IOException;
4
import net.minecraft.network.Packet;
5
import net.minecraft.network.PacketBuffer;
6
import net.minecraft.network.play.INetHandlerPlayClient;
7
import net.minecraft.world.EnumDifficulty;
8
import net.minecraft.world.WorldSettings;
9
import net.minecraft.world.WorldType;
10
11
public class S01PacketJoinGame implements Packet<INetHandlerPlayClient>
12
{
13
    private int entityId;
14
    private boolean hardcoreMode;
15
    private WorldSettings.GameType gameType;
16
    private int dimension;
17
    private EnumDifficulty difficulty;
18
    private int maxPlayers;
19
    private WorldType worldType;
20
    private boolean reducedDebugInfo;
21
22
    public S01PacketJoinGame()
23
    {
24
    }
25
26
    public S01PacketJoinGame(int entityIdIn, WorldSettings.GameType gameTypeIn, boolean hardcoreModeIn, int dimensionIn, EnumDifficulty difficultyIn, int maxPlayersIn, WorldType worldTypeIn, boolean reducedDebugInfoIn)
27
    {
28
        this.entityId = entityIdIn;
29
        this.dimension = dimensionIn;
30
        this.difficulty = difficultyIn;
31
        this.gameType = gameTypeIn;
32
        this.maxPlayers = maxPlayersIn;
33
        this.hardcoreMode = hardcoreModeIn;
34
        this.worldType = worldTypeIn;
35
        this.reducedDebugInfo = reducedDebugInfoIn;
36
    }
37
38
    /**
39
     * Reads the raw packet data from the data stream.
40
     */
41
    public void readPacketData(PacketBuffer buf) throws IOException
42
    {
43
        this.entityId = buf.readInt();
44
        int i = buf.readUnsignedByte();
45
        this.hardcoreMode = (i & 8) == 8;
46
        i = i & -9;
47
        this.gameType = WorldSettings.GameType.getByID(i);
48
        this.dimension = buf.readByte();
49
        this.difficulty = EnumDifficulty.getDifficultyEnum(buf.readUnsignedByte());
50
        this.maxPlayers = buf.readUnsignedByte();
51
        this.worldType = WorldType.parseWorldType(buf.readStringFromBuffer(16));
52
53
        if (this.worldType == null)
54
        {
55
            this.worldType = WorldType.DEFAULT;
56
        }
57
58
        this.reducedDebugInfo = buf.readBoolean();
59
    }
60
61
    /**
62
     * Writes the raw packet data to the data stream.
63
     */
64
    public void writePacketData(PacketBuffer buf) throws IOException
65
    {
66
        buf.writeInt(this.entityId);
67
        int i = this.gameType.getID();
68
69
        if (this.hardcoreMode)
70
        {
71
            i |= 8;
72
        }
73
74
        buf.writeByte(i);
75
        buf.writeByte(this.dimension);
76
        buf.writeByte(this.difficulty.getDifficultyId());
77
        buf.writeByte(this.maxPlayers);
78
        buf.writeString(this.worldType.getWorldTypeName());
79
        buf.writeBoolean(this.reducedDebugInfo);
80
    }
81
82
    /**
83
     * Passes this Packet on to the NetHandler for processing.
84
     */
85
    public void processPacket(INetHandlerPlayClient handler)
86
    {
87
        handler.handleJoinGame(this);
88
    }
89
90
    public int getEntityId()
91
    {
92
        return this.entityId;
93
    }
94
95
    public boolean isHardcoreMode()
96
    {
97
        return this.hardcoreMode;
98
    }
99
100
    public WorldSettings.GameType getGameType()
101
    {
102
        return this.gameType;
103
    }
104
105
    public int getDimension()
106
    {
107
        return this.dimension;
108
    }
109
110
    public EnumDifficulty getDifficulty()
111
    {
112
        return this.difficulty;
113
    }
114
115
    public int getMaxPlayers()
116
    {
117
        return this.maxPlayers;
118
    }
119
120
    public WorldType getWorldType()
121
    {
122
        return this.worldType;
123
    }
124
125
    public boolean isReducedDebugInfo()
126
    {
127
        return this.reducedDebugInfo;
128
    }
129
}

Deobfuscated MCP 1.8.9 source of S01PacketJoinGame, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/server/S01PacketJoinGame.java) at build time and verified present.

Deep Dive

Role in the protocol

The first PLAY-state packet and the world-join trigger. ServerConfigurationManager sends it as the final step of player placement: new S01PacketJoinGame(entityId, gameType, hardcore, dimension, difficulty, maxPlayers, worldType, reducedDebugInfo). The client handler is where the world is born: NetHandlerPlayClient.handleJoinGame creates the PlayerControllerMP and WorldClient from the packet's world type and dimension, calls loadWorld, sets the player's entity id and dimension, shows GuiDownloadTerrain, and replies with the MC|Brand custom payload. Everything that needs mc.theWorld or mc.thePlayer non-null waits on this packet.

Vanilla handling

handleJoinGame first runs PacketThreadUtil.checkThreadAndEnqueue, which in the Rise 6.x and Tenacity trees special-cases S01PacketJoinGame in clientPreProcessPacket so the world creation is guaranteed on the main thread. Then: this.gameController.playerController = new PlayerControllerMP(...), this.clientWorldController = new WorldClient(this, new WorldSettings(...), ...), loadWorld, dimension and entity id assignment, currentServerMaxPlayers, reduced-debug flag, game type set, settings re-sent, and the C17PacketCustomPayload MC|Brand reply. After that the server streams chunks and the respawn/spawn chain.

Why clients touch it

Three non-vanilla references exist in the corpus. NetworkAPI (script api) lists S01PacketJoinGame.class at index 1 of its clientbound packet table, so JavaScript scripts can construct and inject it and can key script logic off world join. VulcanSpeed (movement/speed) imports the class but never uses it: the reference is a dead import. LiquidSense Dev's MixinNetHandlerPlayClient injects at handleJoinGame HEAD, cancellable, and re-runs the whole world-creation sequence itself when AntiForge blockFML is enabled, so the stock (Forge-aware) handler never executes. The clients that need join-time resets (Rise 5.99's WorldChangedEvent, Sigma's event system) fire their own world-change events from elsewhere rather than hooking this packet.

Exploit surface

S01PacketJoinGame carries no movement data, so anti-cheats ignore it; its value is state. A module that misorders its join handling can inherit stale state: old entity id, wrong dimension, or a game type that contradicts the client's PlayerControllerMP. The vanilla handler is also the moment the client reveals its brand via MC|Brand, which server plugins use for client detection. Script-injected S01 packets (NetworkAPI receivePacket) let a script replay a join outside the normal flow, which desynchronizes client and server state; none of the 8 clients ships a module that does this.

Server-Side Handling

ServerConfigurationManager.initializeConnectionToPlayer builds the S01 payload from the player's game type, hardcore flag, the world provider's dimension id, difficulty, server max players, terrain type, and the reducedDebugInfo gamerule, then sends it as the first packet of the PLAY stream. The server then follows with S41PacketServerDifficulty, spawn position, and the chunk bulk. The client's MC|Brand reply arrives as C17PacketCustomPayload and is how vanilla records the client mod name.

Protocol Analysis

Wire layout: int entityId, unsigned byte gamemode, byte dimension (signed: -1 nether, 0 overworld, 1 end), unsigned byte difficulty, unsigned byte maxPlayers, String worldType, boolean reducedDebugInfo. Ordering constraint: S01 is the very first PLAY-state packet; the client transitions the connection into PLAY on login success and expects S01 before any world-bearing packet. Re-sent on dimension change only via the respawn path, never as a plain re-join.

Anti-Cheat Landscape

No anti-cheat measures this packet; it precedes position tracking. The security-relevant detail is the MC|Brand exchange immediately after it: brand-based client detection is a server plugin reading the C17 reply, and clients that want to hide their brand forge that packet, not this one. State-reset discipline after S01 matters for movement modules (fresh timer baselines), which is the reason Rise 6.x scripts hook it.

implementation Implementation Cases

The world-join packet: vanilla handleJoinGame constructs the entire client world from its fields. Module interest is minimal in the corpus: Rise 6.x exposes it to scripts via NetworkAPI, one Rise 6.2.4 speed mode carries a dead import, and LiquidSense Dev re-implements the handler in a cancellable mixin for AntiForge blockFML. World-change events in the other clients fire from their own infrastructure.

NetworkAPI (script api) (Rise 6.1.30, Rise 6.2.4)

Expose S01PacketJoinGame to JavaScript scripts: scripts can detect world join and inject or read the packet through the Network API object.

NetworkAPI keeps two Class arrays indexed by packet id (serverbound and clientbound). S01PacketJoinGame sits at clientbound index 1. instantiatePacket picks the constructor matching the argument count and either sends the packet through addToSendQueue or injects it into the receive queue via addToReceiveQueue; scripts call Network.receivePacket(1, params) to synthesize a join packet client-side.

Source: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/script/api/NetworkAPI.java

Vanilla hook: No event hook; a direct script API. Scripts register packet listeners through the same Network object and receive S01PacketJoinGame instances as typed objects.
Read-side use is invisible to the server. Injecting a synthetic S01 via receivePacket desynchronizes client world state from the server and would cascade into movement flags, but no shipped script does this.
Variations: Rise 6.1.30 ships the identical file at com/alan/clients/script/api/NetworkAPI.java; the clientbound table (and S01's index 1) matches 6.2.4 exactly.
VulcanSpeed (Rise 6.2.4)

A Vulcan-server speed mode; its only link to this packet is an unused import.

The corpus hit is line 28, `import net.minecraft.network.play.server.S01PacketJoinGame;`, and a grep of the whole file confirms no other occurrence: the import is dead. The mode itself implements a Vulcan bypass via block-placement tricks (C08PacketPlayerBlockPlacement against BlockAir checks) and never reads join state.

Source: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/module/impl/movement/speed/VulcanSpeed.java

Vanilla hook: None. The reference is an import only; the mode runs on motion events.
The dead import has no detection relevance. It suggests the author once planned a join-triggered state reset (common for speed modes that must survive world changes) and dropped it.
Variations: No other client references S01PacketJoinGame from a module; all remaining corpus hits are vanilla.
MixinNetHandlerPlayClient (AntiForge) (LiquidSense Dev)

Re-implement NetHandlerPlayClient.handleJoinGame at the mixin level so LiquidBounce joins without the stock handler, backing the AntiForge blockFML mode.

handleJoinGameWithAntiForge injects at handleJoinGame HEAD, cancellable. When AntiForge.enabled and blockFML are on (and the world is not singleplayer) it runs the entire vanilla world-creation sequence itself: new PlayerControllerMP, new WorldClient from packetIn's dimension/difficulty/world type, loadWorld, entity id and dimension assignment, max players, reduced-debug flag, game type, settings re-sent, then the MC|Brand C17PacketCustomPayload reply, and cancels the vanilla method so the default handler never runs.

Source: LiquidSense Dev, net/ccbluex/liquidbounce/injection/forge/mixins/network/MixinNetHandlerPlayClient.java

Vanilla hook: @Inject on NetHandlerPlayClient.handleJoinGame (HEAD, cancellable); the same mixin also overwrites handleConfirmTransaction and injects addToSendQueue and entity-movement events.
No anti-cheat surface: S01 precedes position tracking. The detection-relevant detail is the MC|Brand payload the mixin sends with the client's mod name, which server plugins read for client identification; blockFML targets Forge mod checks, not anti-cheats.
Variations: Rise 6.x reaches S01 only through its script API (NetworkAPI clientbound table index 1) plus a dead VulcanSpeed import; Memeware, Nekoware, Rise 5.99, Sigma 4.11, Spicy, Tenacity 6.0 and November Recode 2.0 have no module-level join-game hook.
Rise 6.x scripts access the packet through the NetworkAPI object; LiquidSense Dev replaces the vanilla handler with a cancellable @Inject mixin (AntiForge blockFML); the other 7 clients have no module-level hook for this packet and rely on their own world-change events.
Rise 6.1.30 and 6.2.4 both ship NetworkAPI and the vanilla handler with PacketThreadUtil special-casing S01PacketJoinGame; Tenacity 6.0 also carries the PacketThreadUtil special case; Memeware, Nekoware, Sigma, Spicy use the stock handler without module involvement. LiquidSense Dev is the only client that intercepts handleJoinGame itself, cancelling the vanilla handler in favor of its own world-creation sequence.

anticheat Anti-Cheat Checks

Server-side anticheats treat the join-game packet as the state anchor of a play session. It carries no movement or combat data, so no check flags it; instead the packet re-reads the player model (entity id, gamemode, dimension, world name) in modern simulation anticheats, while classic anticheats watch the login events that surround the join. The security-relevant detail is what the packet resets: any anticheat that keeps per-player state must re-arm it here or every later check inherits stale data.

Join-game state reset (Grim) (GrimAnticheat-Grim)

Re-sync the simulated player model to the join-game payload: entity id, gamemode, dimension, world name and the death-screen flag.

PacketPlayerRespawn listens on PacketSendEvent with HIGH priority. The JOIN_GAME branch wraps the packet as WrapperPlayServerJoinGame, copies entityId, gamemode, dimensionType and worldName into the GrimPlayer, sets showsDeathScreen from isRespawnScreenEnabled on 1.15+ clients, and re-arms the compensated world dimension on 1.17+ servers. The same listener owns the respawn and update-health branches, so this file is the single state-reset point for the whole session lifecycle.

Detects: Nothing directly: it prevents desync between the server's world state and the movement simulation, which is the precondition for every later check. A player model that never received its join payload would false-flag reach, fly and velocity checks.

Source: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/events/packets/PacketPlayerRespawn.java

Variations: Shard's PacketListener routes JOIN_GAME into handleJoinGame, which stores the entity id and gamemode and clears the compensated entity list. Artemis registers GPacketPlayServerLogin in its packet repository (SERVER_PLAY + 40) and fires LoginCallback on login success. Daedalus starts a 60-tick lastLogin timer used to exempt movement checks after join.
Join-game handling (Shard) (KaelusAI-Shard)

Initialize the per-player packet state when the play session starts: entity id, gamemode and a clean compensated entity list.

PacketListener.onPacketSend switches on Play.Server packet types. JOIN_GAME is wrapped as WrapperPlayServerJoinGame and passed to handleJoinGame, which stores the entity id and gamemode on the ShardPlayer and clears compensatedEntities. The same dispatch routes RESPAWN, the SPAWN_* family and DESTROY_ENTITIES, so the join handler is one branch of the packet-state machine that all simulation checks consume.

Detects: Nothing by itself. It guarantees the entity id used by the client-side self entity matches the server's, which every movement and combat check assumes.

Source: KaelusAI-Shard, src/main/kotlin/ac/shard/packet/PacketListener.kt

Variations: Grim does the same job inside PacketPlayerRespawn; Hydro resets state from the login-success packet instead (PacketEventsJoinQuitListener). Shard also records login timestamps into its violation database (recordLogin) for session analytics.
Logins (NoCheatPlus) (Updated-NoCheatPlus-NoCheatPlus)

Rate-limit simultaneous logins to blunt login-flood spam bots that join and disconnect repeatedly.

A CHAT_LOGINS check driven by ChatListener.onPlayerLogin. It buckets login timestamps into a six-slot ActionFrequency ring per world (or globally when per-world counting is off), scores the bucket sum against cc.loginsLimit and cancels the login when the rate exceeds it. The join-game packet itself is never parsed; the check keys off the Bukkit PlayerLoginEvent that fires around the join handshake, which is how 1.8-generation anticheats watch the join domain without touching packet code.

Detects: Login spam and mass-bot joins; the paired Relog check adds per-player relog throttling with a configurable deny list.

Source: Updated-NoCheatPlus-NoCheatPlus, NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/chat/Logins.java

Variations: Negativity and BetterAnticheat (Velocity) do the same on PostLoginEvent; Artemis runs LoginCallback after login success; Daedalus and NCP both keep a per-player login timestamp used by movement exemptions, which is the other common join-domain pattern.

Wiki Cross-Reference

First PLAY packet (id 0x01): int entityId, gamemode byte, signed dimension byte -1/0/1, difficulty, maxPlayers, level-type string, reducedDebug bool.

Handler builds WorldClient and PlayerControllerMP, sets entity id and dimension, shows terrain GUI and replies MC|Brand C17.

MCP 1.8.9 S01PacketJoinGame implements Packet dispatching to INetHandlerPlayClient.handleJoinGame; wire serde is readPacketData/writePacketData via readBoolean, readByte, readInt, readStringFromBuffer, readUnsignedByte.

1.8.9 callers: ServerConfigurationManager.initializeConnectionToPlayer sends new S01PacketJoinGame (line 143): https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/server/management/ServerConfigurationManager.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.