-
-
Notifications
You must be signed in to change notification settings - Fork 978
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
TypeError: Cannot set properties of undefined (setting 'height') #3281
Comments
To me this looks like somehow the client is trying to set the height field of bot.entity when bot.entity is null. (which doesn't make much sense since that is set on the login packet.) Now it could be the server lobby is doing something weird in regards to the packets its sending that mineflayer can't deal with but vanilla clients can. Any details about the server you can share? |
Please enable debug logging and post the console output. You can do that by adding process.env.DEBUG = 'minecraft-protocol' To the top of your script |
I added process.env.DEBUG = 'minecraft-protocol', but nothing has changed, as soon as I run the JS script, it stops working for the same reason.. bot.entity.height = 1.62 p.s. sorry for closing issue, missed the button |
Nothing is supposed to change, it's supposed to log data to the console. If it did not then you did not addd it correctly like I said (to the top of your script). |
sorry, I really put it in the wrong place, here are the logs from the console with the debug TypeError: Cannot set properties of undefined (setting 'height') |
Versions
Detailed description of a problem
When I launch the bot to the server, I get a crash and a height-related error in response. I think this is due to checking for cheats in the server lobby.
This is the error:
TypeError: Cannot set properties of undefined (setting 'height')
at Client. (C:\Users\anxxd\Desktop\DXN\node_modules\mineflayer\lib\plugins\physics.js:335:23)
at Client.emit (node:events:517:28)
at emitPacket (C:\Users\anxxd\Desktop\DXN\node_modules\minecraft-protocol\src\client.js:83:12)
at FullPacketParser. (C:\Users\anxxd\Desktop\DXN\node_modules\minecraft-protocol\src\client.js:112:9)
at addChunk (C:\Users\anxxd\Desktop\DXN\node_modules\protodef\node_modules\readable-stream\lib_stream_readable.js:279:12)
at readableAddChunk (C:\Users\anxxd\Desktop\DXN\node_modules\protodef\node_modules\readable-stream\lib_stream_readable.js:262:11)
at Readable.push (C:\Users\anxxd\Desktop\DXN\node_modules\protodef\node_modules\readable-stream\lib_stream_readable.js:228:10)
at Transform.push (C:\Users\anxxd\Desktop\DXN\node_modules\protodef\node_modules\readable-stream\lib_stream_transform.js:132:32)
at FullPacketParser._transform (C:\Users\anxxd\Desktop\DXN\node_modules\protodef\src\serializer.js:89:10)
What did you try yet?
Change version of protocol, add "if(!bot.entity) {
bot.entity = {}
}". In general, no matter what I did, it didn't help. In other servers everything is ok/
Did you try any method from the API? Yeap, but nothing helped
Did you try any example? Any error from those? Same error.
Your current code
Expected behavior
So that the bot can just log in to the server.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: