Skip to content

Issue with passengers: Cannot read properties of null (reading 'passengers') #3632

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

Open
1 task done
amplitudesxd opened this issue Apr 2, 2025 · 1 comment
Open
1 task done
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f

Comments

@amplitudesxd
Copy link

amplitudesxd commented Apr 2, 2025

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

Versions

  • mineflayer: 4.27.0
  • server: 1.8.9 (Hypixel)
  • node: 20.15.1

Detailed description of a problem

When in Hypixel lobbies, there are errors relating to passengers that are not present on older mineflayer versions (such as 4.20.1). I am testing the latest version of Mineflayer, 4.27.0 which has fixes related to passengers, but the issue still persists.

/root/apps/hypixel-bot/node_modules/.pnpm/[email protected][email protected]/node_modules/minecraft-protocol/src/transforms/framing.js:67
          } else { throw e }
                   ^
TypeError: Cannot read properties of null (reading 'passengers')
    at Client.<anonymous> (/root/apps/hypixel-bot/node_modules/.pnpm/[email protected][email protected]/node_modules/mineflayer/lib/plugins/entities.js:816:13)

What did you try yet?

I have tried multiple different mineflayer versions. Before 4.27.0, you could not join the server before getting kicked. Now, it doesn't fail to connect to the server, though does kick after a few seconds.

Mineflayer 4.20.1 is the last working version I found.

Your current code

(summarized)

const bot = mineflayer.createBot({
  host: 'hypixel.net',
  auth: 'microsoft',
  version: '1.8.9',
});

bot.chat('/l bw');
bot.chat('/swaplobby 1');

// now just wait, the bot will crash shortly

Additional context

Implementing null checks before accessing the passengers property prevents the error, but appears to be addressing the symptom rather than the underlying cause:

// Only push to passengers if vehicle is not null
if (vehicle && vehicle.passengers) {
  vehicle.passengers.push(passenger)
}
@amplitudesxd amplitudesxd added possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f labels Apr 2, 2025
@amplitudesxd
Copy link
Author

Appears to fixed by #3619 as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f
Projects
None yet
Development

No branches or pull requests

1 participant