question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot join to a server hosted by minecraft-protocol on 1.15

See original GitHub issue

The story

I installed minecraft-protocol via: npm i git+https://github.com/PrismarineJS/node-minecraft-protocol because NPM version seems a little bit outdated.

So I’m using the latest committed version from master branch, which at this moment is 28b52a91589215f985d513102ddcd201a2d248a6

Of course I verified that:

$ npm ls minecraft-protocol
mp-test@1.0.0 C:\Users\kazi\Code\mp-test
`-- minecraft-protocol@1.11.0  (git+https://github.com/PrismarineJS/node-minecraft-protocol.git#28b52a91589215f985d513102ddcd201a2d248a6)

And I tried to run ‘hello world’ example (with both online-mode and encryption disabled):

const mc = require('minecraft-protocol')

const server = mc.createServer({
    'online-mode': false,
    encryption: false,
    host: '0.0.0.0',
    port: 25565
})

server.on('login', client => {
    client.write('login', {
        entityId: client.id,
        levelType: 'default',
        gameMode: 0,
        dimension: 0,
        difficulty: 2,
        maxPlayers: server.maxPlayers,
        reducedDebugInfo: false
    })

    client.write('position', {
        x: 0,
        y: 1.62,
        z: 0,
        yaw: 0,
        pitch: 0,
        flags: 0x00
    })
})

Expectations

  • should work flawlessly on 1.15.x, like it does on 1.14.4

Reality

$ DEBUG=minecraft-protocol node app.js
  minecraft-protocol read packet handshaking.set_protocol +0ms
  minecraft-protocol {
  minecraft-protocol   "protocolVersion": 578,
  minecraft-protocol   "serverHost": "127.0.0.1",
  minecraft-protocol   "serverPort": 25565,
  minecraft-protocol   "nextState": 2
  minecraft-protocol } +2ms
  minecraft-protocol read packet login.login_start +3ms
  minecraft-protocol {
  minecraft-protocol   "username": "kazigk"
  minecraft-protocol } +1ms
  minecraft-protocol writing packet login.compress +1ms
  minecraft-protocol { threshold: 256 } +0ms
  minecraft-protocol writing packet login.success +4ms
  minecraft-protocol { uuid: 'e3975c5f-6b2d-3e85-a377-feea362a5b82', username: 'kazigk' } +1ms
  minecraft-protocol writing packet play.login +204ms
  minecraft-protocol {
  minecraft-protocol   entityId: 0,
  minecraft-protocol   levelType: 'default',
  minecraft-protocol   gameMode: 0,
  minecraft-protocol   dimension: 0,
  minecraft-protocol   difficulty: 2,
  minecraft-protocol   maxPlayers: 20,
  minecraft-protocol   reducedDebugInfo: false
  minecraft-protocol } +0ms
  minecraft-protocol writing packet play.kick_disconnect +3ms
  minecraft-protocol {
  minecraft-protocol   reason: `{"text":"TypeError: Serialization error for play.toClient.login.hashedSeed : Write error for params.login.hashedSeed : Cannot read property '0' of undefined"}`
  minecraft-protocol } +3ms
  minecraft-protocol writing packet play.position +3ms
  minecraft-protocol { x: 0, y: 1.62, z: 0, yaw: 0, pitch: 0, flags: 0 } +3ms
  minecraft-protocol writing packet play.kick_disconnect +3ms
  minecraft-protocol { reason: '{"text":"Error: read ECONNRESET"}' } +0ms

Additional info

  • Error was reproduced using Minecraft 1.15.2
  • I also tried with release 1.11.0 and Minecraft 1.15.1, same result

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
wvfflecommented, Mar 31, 2020

Add hashedSeed: [0, 0] to your login packet data

0reactions
wvfflecommented, Mar 31, 2020

Add hashedSeed: [0, 0] to your login packet data

wat is that?

Our packet names differ a bit from the names you have on wiki.vg but here you can find that those are first 8 bits of world’s seed: https://wiki.vg/Protocol#Join_Game

Read more comments on GitHub >

github_iconTop Results From Across the Web

I just updated my server to Paper 1.15 and I get this error ...
I just updated my server to Paper 1.15 and I get this error when I try to join, any help? r/admincraft - I...
Read more >
After restarting my MC server i cannot connect to it anymore.
Hello, So i recently built a new pc and decided to ue my old pc as a minecraft 1.15.2 server for me and...
Read more >
Players cannot join the server when running on Java 15 #978
Steps to reproduce the behavior: Use Java 15 on a server with protocollib. Try to join the server and be disconnected due to...
Read more >
How to Fix "Can't Connect to Server" in Minecraft: 13 Steps
1. Check that your connection is enabled. On most devices, the Wi-Fi icon resembles a dot with three or four arching lines over...
Read more >
Tutorials/Setting up a server - Minecraft Wiki - Fandom
Port forwarding is used when you have a router and you wish to let users connect to your server through it. If you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found