PrismarineJS / mineflayer

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

TypeError: Cannot set properties of undefined (setting 'height') #3067

Closed DanyVolk closed 1 year ago

DanyVolk commented 1 year ago

Versions

When you log on to the server, the code turns off and an error pops up.

I tried the bot.EntityInS method

No. I tried the very initial example.

Your current code

const bot = mineflayer.createBot({ host: serverAddress, port: serverPort, username: username, });

/ const bot = mineflayer.createBot({ host: serverAddress, port: serverPort, username: username, }); /



I was expecting to see the bot log in to the server

ypeError: Cannot set properties of undefined (setting 'height')
    at Client.<anonymous> (/home/daniil/node_modules/mineflayer/lib/plugins/physics.js:264:23)
extremeheat commented 1 year ago

This is a problem with your code, likely due to you not waiting for the correct event like spawn before calling a mineflayer API. Please go to the discord and provide all the code you used to reproduce the error.