-
-
Notifications
You must be signed in to change notification settings - Fork 255
Open
Labels
Description
[x] The FAQ doesn't contain a resolution to my issue
Versions
- minecraft-protocol: 1.55.0
- server: vanilla/spigot/paper 1.21.4
- node: 22.14.0
Detailed description of a problem
I'm trying to set up a simple offline-mode server that (currently) only spawns the player in a void world. The following code works for other versions (tested for 1.8 with slight adaptations to the login packet, 1.18, 1.19 and 1.20 with the same code, different data versions). Attempting to run the same code with 1.21 results in the connection being lost and the following error being shown:
Internal Exception: io.netty.handler.codec.DecoderException: Failed to decode packet 'clientbound/minecraft:cookie_request'
.
Current code
const mc = require("minecraft-protocol")
const mcData = require("minecraft-data")("1.21")
const server = mc.createServer({
host: "127.0.0.1",
port: 25565,
version: "1.21",
"online-mode": false,
})
server.on("login", (client) => {
const p = mcData.loginPacket
console.log(p)
client.write("login", {
...p,
})
client.write("position", {
x: 0,
y: 0,
z: 0,
yaw: 0,
pitch: 0,
})
})
Expected behavior
The client should spawn in an empty world at the coordinates 0/0/0 immediately upon joining the server.