PrismarineJS / PrismarineJS/node-minecraft-protocol
Disconnecting players during the Login phase results in errors in 1.19+
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 290
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 7
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+).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the createServer setup and login handler shown in the issue, reproducing client.end("Test") against the listed Minecraft versions. Compare the disconnect behavior and packet decoding across versions; done means players disconnect with the Test message without profile-key, namespace, or cookie-request errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100