PrismarineJS / mineflayer

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

TypeError: Cannot read properties of undefined (reading 'blocksByName') #3362

Closed Krstf01 closed 1 month ago

Krstf01 commented 2 months ago

Versions

Detailed description of a problem

The bot is not even able to load.

What did you try yet?

I tried to use the pathfinder plugin, but it thrown this error: "TypeError: Cannot read properties of undefined (reading 'blocksByName')"

Your current code


const defaultMove = new Movements(bot)

Expected behavior

No errors at start or at any point.

Additional context

The other parts of my code worked without the line i highlited before.

extremeheat commented 1 month ago

You did not provide any code, so it's not possible to say more without looking at it. You are likely not waiting for the correct events. Copy the code from https://github.com/PrismarineJS/mineflayer/blob/master/examples/pathfinder/gps.js