---
title: Custom Query
description: "Login 0x04, server → client."
---

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

Login plugin request. The server sends a `messageId`, a namespaced `channel`, and raw `data` to negotiate with modded clients or proxies before login completes. The client must respond with `CustomQueryAnswer` using the same `messageId`.

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

## Fields

| Field | Type | Notes |
|---|---|---|
| `messageId` | VarInt |  |
| `channel` | String |  |
| `data` | Byte[] |  |

## Send it

```ts
await client.sendPacket("CustomQuery", {
  messageId: /* VarInt */,
  channel: /* String */,
  data: /* Byte[] */,
});
```

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

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