PrismarineJS / PrismarineJS/node-minecraft-protocol

server with latest versions results a protocol error

Open
#1,384 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

possible bug
Dominant language
JavaScript
Stars
1.4k
Forks
290
Avg merge
4d 8h
Merged PRs (30d)
7

Description

Versions

  • minecraft-protocol: 1.55.0
  • client: Vanilla 1.21.4
  • node: 22.14.0

Detailed description of a problem

In the latest version of Minecraft (including few versions before 1.21.4) I cannot enter my simple server program, from my Vanilla client.
The problem seems to be with some sort of registry loading, after reading the debug log of the Minecraft client (disconnect-...-client.txt).
And if it helps, the message on my screen once the error occurs is "Network Protocol Error"

Current code

const mc = require('minecraft-protocol')
const server = mc.createServer({
  'online-mode': true,
  port: 25565,
  version: '1.21.4'
})

server.on('playerJoin', function (client) {

  client.write('login', {
    ...mcdata.loginPacket,
    entityId: client.id,
    isHardcore: false,
    gameMode: 2,
    previousGameMode: 2,
    worldName: 'minecraft:overworld',
    hashedSeed: [0, 0],
    maxPlayers: server.maxPlayers,
    viewDistance: 2,
    reducedDebugInfo: false,
    enableRespawnScreen: true,
    isDebug: false,
    isFlat: true
  })

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

Expected behavior

The client should connect to the server without any client side errors which prevent it from completing the joining process.

Additional context

Here is the debug log file I mentioned in the description:
disconnect-2025-03-24_10.05.31-client.txt

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the connection failure with the listed minecraft-protocol, Minecraft, and Node versions, then inspect disconnect-2025-03-24_10.05.31-client.txt. Trace the createServer and playerJoin entry points in the current code to identify the registry or login-packet mismatch. Done means a Vanilla 1.21.4 client completes joining without a network protocol error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.