mineflayer icon indicating copy to clipboard operation
mineflayer copied to clipboard

Unable to join server

Open DaanB1 opened this issue 1 year ago • 5 comments

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

Versions

  • mineflayer: 4.20.1
  • server: details unknown, but probably spigot (the server is IP munchymc.com)
  • node: 20.9.0

Detailed description of a problem

The bot is unable to join the server. However, it does work on other servers. The error occurs on newer minecraft versions such as 1.20.4. Using old versions such as 1.8.9, it is able to join successfully. Using a regular minecraft client, I am able to join the server on version 1.20.4, so the server itself seems to work fine. Here is the error:

C:\Users\daanb\Desktop\FishBot\node_modules\minecraft-protocol\src\transforms\framing.js:67 } else { throw e } ^

TypeError: Cannot read properties of undefined (reading 'overworld') at handleRespawnPacketData (C:\Users\daanb\Desktop\FishBot\node_modules\mineflayer\lib\plugins\game.js:46:63) at Client. (C:\Users\daanb\Desktop\FishBot\node_modules\mineflayer\lib\plugins\game.js:80:5) at Client.emit (node:events:526:35) at emitPacket (C:\Users\daanb\Desktop\FishBot\node_modules\minecraft-protocol\src\client.js:83:12) at FullPacketParser. (C:\Users\daanb\Desktop\FishBot\node_modules\minecraft-protocol\src\client.js:112:9) at FullPacketParser.emit (node:events:514:28) at addChunk (C:\Users\daanb\Desktop\FishBot\node_modules\protodef\node_modules\readable-stream\lib_stream_readable.js:279:12) at readableAddChunk (C:\Users\daanb\Desktop\FishBot\node_modules\protodef\node_modules\readable-stream\lib_stream_readable.js:262:11) at Readable.push (C:\Users\daanb\Desktop\FishBot\node_modules\protodef\node_modules\readable-stream\lib_stream_readable.js:228:10) at Transform.push (C:\Users\daanb\Desktop\FishBot\node_modules\protodef\node_modules\readable-stream\lib_stream_transform.js:132:32)

Your current code

const mineflayer = require('mineflayer')

const authSettings = {
    username: "redacted",
    host: "munchymc.com",
    port: 25565,
    auth: "microsoft",
    version: "1.20.4"
}

const bot = mineflayer.createBot(authSettings)
bot.once('spawn', () => {
    bot.on('messagestr', (message) => console.log(message))
    bot.on('error', (err) => console.log(err))
})

Additional context

The bot isn't able to join hypixel either. I've also tried authenticating with a different account, and the same issue occurs.

DaanB1 avatar Aug 07 '24 17:08 DaanB1

same error for me

josealissonbr avatar Aug 10 '24 18:08 josealissonbr

Testing on local server with 1.21 and via version enabled. A bot using 1.18 can join but 1.19+ gets the error shown above.

TinyTank800 avatar Aug 10 '24 22:08 TinyTank800

I tried to connect to a 1.21 server with via version enabled and got the same error, but when I set the version parameter in createbot to 1.18 it just worked.

hsiang0117 avatar Aug 25 '24 04:08 hsiang0117

same issue for me, though i can join a 1.20.4 local vanilla server fine but connecting to a public server that also uses 1.20.4 dosnt work

Madlykeanu avatar Sep 29 '24 03:09 Madlykeanu

for anyone else having this issue i added a temporary workaround by just encasing the problematic code in a try catch block https://github.com/Madlykeanu/mineflayer

it dosnt fix the main issue of the thing being undefined but atleast it dosnt crash, seems to work fine for me now as a temporary workaround, if you want to use it you'll have to clone the repo and add it to your dependencies in your mineflayer project.

image

then reinstall dependencies with npm install

Madlykeanu avatar Sep 29 '24 04:09 Madlykeanu