---
title: Login
description: "Identity, optional encryption, and the compression threshold."
---

**11 packets:** 5 serverbound, 6 clientbound.

IDs restart at `0x00` in every state, so the same number means a different packet in `login` than in `play`.

| ID | Direction | Packet | Fields |
|---|---|---|---|
| `0x00` | → server | [Hello](/packets/login/hello-serverbound) | `username`, `playerUUID` |
| `0x01` | → server | [Key](/packets/login/key) | `sharedSecret`, `verifyToken` |
| `0x02` | → server | [CustomQueryAnswer](/packets/login/customqueryanswer) | `messageId`, `data` |
| `0x03` | → server | [LoginAcknowledged](/packets/login/loginacknowledged) |  |
| `0x04` | → server | [CookieResponse](/packets/login/cookieresponse) | `key`, `value` |
| `0x00` | → client | [LoginDisconnect](/packets/login/logindisconnect) | `reason` |
| `0x01` | → client | [Hello](/packets/login/hello-clientbound) | `serverId`, `publicKey`, `verifyToken`, `shouldAuthenticate` |
| `0x02` | → client | [LoginFinished](/packets/login/loginfinished) | `gameProfile`, `sessionId` |
| `0x03` | → client | [LoginCompression](/packets/login/logincompression) | `threshold` |
| `0x04` | → client | [CustomQuery](/packets/login/customquery) | `messageId`, `channel`, `data` |
| `0x05` | → client | [CookieRequest](/packets/login/cookierequest) | `cookie` |
