Unable to join server
- [ ] 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.
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.
same error for me
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.
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.
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
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.
then reinstall dependencies with npm install