When a client completes configuration, the server transitions them to the Play state through these steps:
Upon receiving FinishConfigurationAcknowledged:
MinecraftEntityId from EntityIdCounterWorldGenerator::surface_height_at() if not explicitly setConnectionState(Play)MinecraftEntityIdPosition, PreviousPosition, RotationTeleportState { next_id: 1, pending_id: Some(0) }KeepAliveState { last_sent_id: 0, awaiting_response: false }CurrentChunkPos, EffectiveViewDistance, LoadedChunksPlayerDimension(Overworld)The server sends a burst of packets to set up the client:
initial_chunk_radius)An optimization sends the teleport after 9 chunks (3x3 center) are sent, so the player can start rendering while remaining chunks arrive.
After all initial packets are sent, PlayerJoinEvent is triggered. At this point the player's entity has all components but does not have PlayerReady yet.
When the client finishes loading chunks and sends PlayerLoaded:
PlayerReady marker component is insertedPlayerReadyEvent is triggeredThe PlayerReady marker component is the key indicator that a player is fully in-game. Most systems filter on it:
A player without PlayerReady is in a transitional state (loading chunks, not yet visible to others).
When a player becomes ready, the on_player_ready observer handles mutual visibility:
All player visibility goes through PlayerInfoUpdate packets containing:
true)When a client disconnects:
disconnect channelingest_network_packets drains the disconnect channelClientToEntityMapPlayerReady present):
PlayerQuitEvent is triggeredon_player_quit observer broadcasts to all remaining ready players:
RemoveEntities — Removes the entity from the worldPlayerInfoRemove — Removes the player from the tab listThe broadcast_position system runs in PostUpdate and sends movement updates to all other players:
Position changes are encoded as fixed-point deltas:
Yaw and pitch are converted from degrees to a single byte:
For each player with changed Position or Rotation:
UpdateEntityPositionAndRotation — Combined position delta + rotationSetHeadRotation — Head yaw (for smooth head turning)The update_previous_positions system runs after broadcasting to sync PreviousPosition with current Position.
Server-initiated teleportation (e.g., /tp command) works through:
TeleportState: Increment next_id, set pending_id to the new IDPosition: Set the entity's position to target coordinatesSynchronizePlayerPosition: Packet with teleport ID, target coordinates, and current rotationConfirmTeleportation packet clears pending_idWhile pending_id is Some, the server knows a teleportation is in-flight and the client has not yet acknowledged it.
When a player sends a chat message:
<PlayerName> messageSystemChat packet (NBT text component) is broadcast to all ready playersChatMessageEvent is triggered for plugin observersMessages starting with / are intercepted and routed to the command system, even if sent as ChatMessage rather than ChatCommand (this handles commands the client doesn't recognize from the command tree).