Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.18 not working #933

Closed
silgames12345 opened this issue Dec 11, 2021 · 14 comments
Closed

1.18 not working #933

silgames12345 opened this issue Dec 11, 2021 · 14 comments
Labels

Comments

@silgames12345
Copy link

[ ] The FAQ doesn't contain a resolution to my issue

Versions

  • minecraft-protocol: 1.29.0
  • server: vanilla/spigot/paper paper 1.18
  • node: 14.18.2
    os
    ubuntu

Detailed description of a problem

letting my client join a 1.17.1 server works but when i try to let it join a 1.18 server it gives this error

events.js:377
      throw er; // Unhandled 'error' event
      ^

Error: Deserialization error for play.toClient : Read error for undefined : unexpected tag end
    at Object.readPString [as nbtTagName] (eval at compile (/home/sil/python/mc proxy/test/node_modules/protodef/src/compiler.js:258:12), <anonymous>:32:31)
    at nbt (eval at compile (/home/sil/python/mc proxy/test/node_modules/protodef/src/compiler.js:258:12), <anonymous>:150:61)
    at CompiledProtodef.read (/home/sil/python/mc proxy/test/node_modules/protodef/src/compiler.js:70:12)
    at Object.readNbt [as nbt] (/home/sil/python/mc proxy/test/node_modules/minecraft-protocol/src/datatypes/minecraft.js:33:20)
    at Object.chunkBlockEntity (eval at compile (/home/sil/python/mc proxy/test/node_modules/protodef/src/compiler.js:258:12), <anonymous>:277:60)
    at eval (eval at compile (/home/sil/python/mc proxy/test/node_modules/protodef/src/compiler.js:258:12), <anonymous>:976:46)
    at Object.packet_map_chunk (eval at compile (/home/sil/python/mc proxy/test/node_modules/protodef/src/compiler.js:258:12), <anonymous>:981:9)
    at eval (eval at compile (/home/sil/python/mc proxy/test/node_modules/protodef/src/compiler.js:258:12), <anonymous>:2181:58)
    at packet (eval at compile (/home/sil/python/mc proxy/test/node_modules/protodef/src/compiler.js:258:12), <anonymous>:2251:9)
    at CompiledProtodef.read (/home/sil/python/mc proxy/test/node_modules/protodef/src/compiler.js:70:12)
Emitted 'error' event on Client instance at:
    at FullPacketParser.<anonymous> (/home/sil/python/mc proxy/test/node_modules/minecraft-protocol/src/client.js:78:12)
    at FullPacketParser.emit (events.js:412:35)
    at errorOrDestroy (/home/sil/python/mc proxy/test/node_modules/readable-stream/lib/internal/streams/destroy.js:98:101)
    at onwriteError (/home/sil/python/mc proxy/test/node_modules/readable-stream/lib/_stream_writable.js:424:5)
    at onwrite (/home/sil/python/mc proxy/test/node_modules/readable-stream/lib/_stream_writable.js:450:11)
    at WritableState.onwrite (/home/sil/python/mc proxy/test/node_modules/readable-stream/lib/_stream_writable.js:160:5)
    at FullPacketParser.afterTransform (/home/sil/python/mc proxy/test/node_modules/readable-stream/lib/_stream_transform.js:89:3)
    at FullPacketParser._transform (/home/sil/python/mc proxy/test/node_modules/protodef/src/serializer.js:86:16)
    at FullPacketParser.Transform._read (/home/sil/python/mc proxy/test/node_modules/readable-stream/lib/_stream_transform.js:177:10)
    at FullPacketParser.Transform._write (/home/sil/python/mc proxy/test/node_modules/readable-stream/lib/_stream_transform.js:164:83) {
  field: 'play.toClient'
}

Current code

var mc = require('minecraft-protocol');
var client = mc.createClient({
    host: "localhost",   // optional
    port: 25565,         // optional
    username: "*****",
    password: "*********",
    auth: 'microsoft',
    version: 1.18
  });

Expected behavior

client should join the server and stay joined

@kashalls
Copy link
Contributor

kashalls commented Dec 11, 2021

1.18 is not fully supported yet.

@rom1504
Copy link
Member

rom1504 commented Dec 11, 2021

It is actually

However this report doesn't give enough information to do anything
Can you enable debug mode (see readme) and report what it says ?

@networkException
Copy link
Contributor

I'm getting the same error, this is the log with debugging enabled:

  minecraft-protocol read packet play.map_chunk +1ms
  minecraft-protocol {
  minecraft-protocol   x: -7,
  minecraft-protocol   z: -3,
  minecraft-protocol   heightmaps: {
  minecraft-protocol     type: 'compound',
  minecraft-protocol     name: '',
  minecraft-protocol     value: { MOTION_BLOCKING: [Object], WORLD_SURFACE: [Object] }
  minecraft-protocol   },
  minecraft-protocol   chunkData: <Buffer 00 00 00 00 00 00 32 00 00 00 00 00 00 00 32 00 00 00 00 00 00 00 32 00 00 00 00 00 00 00 32 00 10 00 04 03 21 01 a8 0b 80 02 00 00 00 00 00 00 00 00 ... 35859 more bytes>,
  minecraft-protocol   blockEntities: [],
  minecraft-protocol   trustEdges: true,
  minecraft-protocol   skyLightMask: [ BigIntExtended(2) [ 0, 3670016 ] ],
  minecraft-protocol   blockLightMask: [ BigIntExtended(2) [ 0, 120832 ] ],
  minecraft-protocol   emptySkyLightMask: [ BigIntExtended(2) [ 0, 524272 ] ],
  minecraft-protocol   emptyBlockLightMask: [ BigIntExtended(2) [ 0, 4073456 ] ],
  minecraft-protocol   skyLight: [
  minecraft-protocol     [
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0,
  minecraft-protocol       ... 1948 more items
  minecraft-protocol     ],
  minecraft-protocol     [
  minecraft-protocol       186, 188, 154, 152, 186, 171, 170, 186, 203,  13,   0, 152,
  minecraft-protocol       186, 171,   9, 169, 220, 222, 160, 169, 203, 188,   0, 160,
  minecraft-protocol       237, 239, 176, 186, 220, 205, 171, 186, 222, 222, 188, 203,
  minecraft-protocol       237, 222, 188, 203, 239, 205, 187, 220, 254, 239, 205, 220,
  minecraft-protocol       222, 222, 204, 237, 255, 239, 205, 221, 237, 239, 221, 254,
  minecraft-protocol       255, 255, 222, 238, 220, 238, 238, 255, 255, 255, 239, 255,
  minecraft-protocol       220, 254, 255, 255, 255, 255, 255, 255, 220, 254, 255, 255,
  minecraft-protocol       255, 255, 255, 255, 203, 237, 238, 254, 255, 239, 238, 255,
  minecraft-protocol       186, 220, 221, 254,
  minecraft-protocol       ... 1948 more items
  minecraft-protocol     ],
  minecraft-protocol     [
  minecraft-protocol       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
  minecraft-protocol       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
  minecraft-protocol       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
  minecraft-protocol       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
  minecraft-protocol       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
  minecraft-protocol       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
  minecraft-protocol       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
  minecraft-protocol       255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
  minecraft-protocol       255, 255, 255, 255,
  minecraft-protocol       ... 1948 more items
  minecraft-protocol     ]
  minecraft-protocol   ],
  minecraft-protocol   blockLight: [
  minecraft-protocol     [
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0,
  minecraft-protocol       ... 1948 more items
  minecraft-protocol     ],
  minecraft-protocol     [
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0,
  minecraft-protocol       ... 1948 more items
  minecraft-protocol     ],
  minecraft-protocol     [
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0,
  minecraft-protocol       ... 1948 more items
  minecraft-protocol     ],
  minecraft-protocol     [
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 1,
  minecraft-protocol       0, 0, 0, 0,
  minecraft-protocol       ... 1948 more items
  minecraft-protocol     ],
  minecraft-protocol     [
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  minecraft-protocol       0, 0, 0, 0,
  minecraft-protocol       ... 1948 more items
  minecraft-protocol     ]
  minecraft-protocol   ]
  minecraft-protocol } +1ms
Error: Deserialization error for play.toClient : Read error for undefined : unexpected tag end
    at Object.readPString [as nbtTagName] (eval at compile (/home/networkexception/projects/gitlab.upi.li/networkException/purevanillabot/node_modules/protodef/src/compiler.js:258:12), <anonymous>:32:31)
    at nbt (eval at compile (/home/networkexception/projects/gitlab.upi.li/networkException/purevanillabot/node_modules/protodef/src/compiler.js:258:12), <anonymous>:150:61)
    at CompiledProtodef.read (/home/networkexception/projects/gitlab.upi.li/networkException/purevanillabot/node_modules/protodef/src/compiler.js:70:12)
    at Object.readNbt [as nbt] (/home/networkexception/projects/gitlab.upi.li/networkException/purevanillabot/node_modules/minecraft-protocol/src/datatypes/minecraft.js:33:20)
    at Object.chunkBlockEntity (eval at compile (/home/networkexception/projects/gitlab.upi.li/networkException/purevanillabot/node_modules/protodef/src/compiler.js:258:12), <anonymous>:277:60)
    at eval (eval at compile (/home/networkexception/projects/gitlab.upi.li/networkException/purevanillabot/node_modules/protodef/src/compiler.js:258:12), <anonymous>:976:46)
    at Object.packet_map_chunk (eval at compile (/home/networkexception/projects/gitlab.upi.li/networkException/purevanillabot/node_modules/protodef/src/compiler.js:258:12), <anonymous>:981:9)
    at eval (eval at compile (/home/networkexception/projects/gitlab.upi.li/networkException/purevanillabot/node_modules/protodef/src/compiler.js:258:12), <anonymous>:2181:58)
    at packet (eval at compile (/home/networkexception/projects/gitlab.upi.li/networkException/purevanillabot/node_modules/protodef/src/compiler.js:258:12), <anonymous>:2251:9)
    at CompiledProtodef.read (/home/networkexception/projects/gitlab.upi.li/networkException/purevanillabot/node_modules/protodef/src/compiler.js:70:12) {
  field: 'play.toClient'
}

@rom1504
Copy link
Member

rom1504 commented Dec 12, 2021

@nickelpro looks like chunkBlockEntity type is broken in map chunk packet

@rom1504
Copy link
Member

rom1504 commented Dec 12, 2021

@silgames12345 @networkException do you have more information as to which server exactly you're connecting on?

the vanilla server doesn't seem to give these errors (our CI is not failing)

@networkException
Copy link
Contributor

It was a modded server initially but I was just able to reproduce it on a vanilla 1.18.1 server

@nickelpro
Copy link
Member

@nickelpro looks like chunkBlockEntity type is broken in map chunk packet

I have a suspicion that NMP is choking on NBT that consists of a single TAG_End tag, which is valid NBT but probably not what the pris-nbt decoder expects

@rom1504
Copy link
Member

rom1504 commented Dec 12, 2021

vanilla 1.18.1

I'm surprised this works at all, since we only added 1.18 support

It was a modded server initially but I was just able to reproduce it on a vanilla 1.18.1 server

did you do anything or does it crash in less than 10s ?

@rom1504
Copy link
Member

rom1504 commented Dec 12, 2021

I have a suspicion that NMP is choking on NBT that consists of a single TAG_End tag, which is valid NBT but probably not what the pris-nbt decoder expects

it should work already, but worth checking

@networkException
Copy link
Contributor

I'm surprised this works at all, since we only added 1.18 support

1.18 is using the same protocol as 1.18.1 (757)

did you do anything or does it crash in less than 10s ?

It crashes after about ~5s

@rom1504
Copy link
Member

rom1504 commented Dec 12, 2021

https://github.com/PrismarineJS/node-minecraft-protocol/runs/4490318121?check_suite_focus=true 1.18 ci is not running any test, that's why we didn't see this
let's fix that

@rom1504 rom1504 changed the title client leaves after a few seconds 1.18 not working Dec 12, 2021
@rom1504 rom1504 added the bug label Dec 12, 2021
@rom1504
Copy link
Member

rom1504 commented Dec 12, 2021

ok ci fixed (just had to rerun to get mcdata last version)
https://github.com/PrismarineJS/node-minecraft-protocol/runs/4498941714?check_suite_focus=true now failing, let's fix it...

@rom1504
Copy link
Member

rom1504 commented Dec 12, 2021

starting fixing at #934

@rom1504
Copy link
Member

rom1504 commented Dec 12, 2021

now fixed
run npm update --depth 9999 to get the fix

@rom1504 rom1504 closed this as completed Dec 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants