Intension
Handshake 0x00, client → server.
handshake · 0x00 · serverbound (client → server)
First packet of every connection. The client sends its protocolVersion, the host and port it connected to, and the nextState it wants (status, login, or transfer). The server uses nextState to switch the connection into the status or login state; no reply is sent.
Sent by the client, read by the server. Listen for it with client.on("Intension", (data) => …) on the receiving side.
Fields
| Field | Type | Notes |
|---|---|---|
protocolVersion |
VarInt | also protocol |
serverHost |
String | also address |
serverPort |
UShort | also port |
nextState |
VarInt | also intent |
Send it
// Client side, right after "Socket:Ready".
await client.sendPacket("Intension", {
protocolVersion: 776,
serverHost: "localhost",
serverPort: 25565,
nextState: 2, // 1 = status, 2 = login, 3 = transfer
});
Send this first on every new socket. nextState picks what the next packet is allowed to be: StatusRequest after 1, Hello after 2. protocol is accepted as an alias for protocolVersion.
Field aliases listed under Notes are accepted as alternative keys when writing.
Source: src/Core/Versions/776/Packets/handshake/serverbound/Intension.ts