-
-
Notifications
You must be signed in to change notification settings - Fork 262
Description
[x] The FAQ doesn't contain a resolution to my issue
Versions
- minecraft-protocol: 1.61.0
- client: vanilla 1.19
- node: 22.18.0
Detailed description of a problem
A clear and concise description of what the problem is.
Current code
import mc from 'minecraft-protocol';
const server = mc.createServer({
'online-mode': true,
encryption: true,
host: '0.0.0.0',
port: 25565,
version: false,
fallbackVersion: mc.defaultVersion,
hideErrors: false,
enforceSecureProfile: true
});
server.on('login', (client) => {
client.end("Test")
});Expected behavior
The user should be disconnected with the message Test.
Additional context
The error message varies depending on the Minecraft version used.
1.18.2: works
1.19: Unable to parse profile public key.
1.20/1.20.1: works
1.20.2/3/4: Internal Exception: io.netty.handler.codec.DecoderException: z: Non [a-z0-9_.-] character in namespace of location: {\"text\":\"Test\"}
1.20.5:/1.21/1.21.5: Internal Exception: io.netty.handler.codec.DecoderException: Failed to decode packet 'clientbound/minecraft:cookie_request'
I'm not sure if all of these are caused by the same bug or if there are different issues at play here, but they are all broken in the same use case. To me, it looks like node-mcp is sending the wrong packet ID for the disconnect packet, and it is interpreted as a cookie request packet instead (1.20.5+).