---
title: Login Disconnect
description: "Login 0x00, server → client."
---

`login` · `0x00` · **clientbound** (server → client)

Disconnects the client during login with a text component `reason`. The server sends it for rejected logins (banned, whitelist, full server, auth failure) and then closes the socket. The client shows the reason on the disconnect screen.

Sent by the server, read by the client. Listen for it with `client.on("LoginDisconnect", (data) => …)` on the receiving side.

## Fields

| Field | Type | Notes |
|---|---|---|
| `reason` | String |  |

## Send it

```ts
await client.sendPacket("LoginDisconnect", {
  reason: JSON.stringify({ text: "You are banned.", color: "red" }),
});
client.destroy();
```

Kicks a client that is still in `login`. `reason` is a text component as a JSON string in this state, unlike the NBT `Disconnect` in `config` and `play`.

Field aliases listed under Notes are accepted as alternative keys when writing.

Source: [`src/Core/Versions/776/Packets/login/clientbound/LoginDisconnect.ts`](https://github.com/GDLev/mc-protocol/blob/master/src/Core/Versions/776/Packets/login/clientbound/LoginDisconnect.ts)
