Skip to content

server with latest versions results a protocol error #1384

@likescookie

Description

@likescookie

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions