PrismarineJS / mineflayer

Create Minecraft bots with a powerful, stable, and high level JavaScript API.
https://prismarinejs.github.io/mineflayer/
MIT License
4.92k stars 904 forks source link

Errors after bot is connected #2708

Closed ThisIsKashakov closed 2 years ago

ThisIsKashakov commented 2 years ago

Versions

Code


const mineflayer = require('mineflayer')

const bot = mineflayer.createBot({
    host: 'ip',
    port: 33217,
    username: 'zombie'
})

bot.once('spawn', () => {
    bot.chat('hi!')
})

Error

TypeError: Deserialization error for play.toClient : Read error for undefined : ctx.varlong is not a function
    at Object.packet_initialize_world_border (eval at compile (/root/tests/node_modules/protodef/src/compiler.js:258:12), <anonymous>:2154:60)
    at eval (eval at compile (/root/tests/node_modules/protodef/src/compiler.js:258:12), <anonymous>:2309:86)
    at packet (eval at compile (/root/tests/node_modules/protodef/src/compiler.js:258:12), <anonymous>:2322:9)
    at CompiledProtodef.read (/root/tests/node_modules/protodef/src/compiler.js:70:12)
    at e.message (/root/tests/node_modules/protodef/src/compiler.js:111:49)
    at tryCatch (/root/tests/node_modules/protodef/src/utils.js:50:16)
    at CompiledProtodef.parsePacketBuffer (/root/tests/node_modules/protodef/src/compiler.js:111:29)
    at FullPacketParser.parsePacketBuffer (/root/tests/node_modules/protodef/src/serializer.js:68:23)
    at FullPacketParser._transform (/root/tests/node_modules/protodef/src/serializer.js:74:21)
    at FullPacketParser.Transform._read (/root/tests/node_modules/readable-stream/lib/_stream_transform.js:177:10) {
  field: 'play.toClient'
}
extremeheat commented 2 years ago

Caused by https://github.com/PrismarineJS/minecraft-data/pull/598 Fixed by https://github.com/PrismarineJS/node-minecraft-protocol/pull/1018 and update was released

You can use npm update --depth 9999 to get the update.