-
-
Notifications
You must be signed in to change notification settings - Fork 986
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
Bot can't transition back into configuration state from play state properly. #3292
Comments
This is likely to be a bug both here (since it keeps doing position updates) and in node-minecraft-protocol. |
I have found a solution and will be submitting two PRs one to mineflayer and one to node-minecraft-protocol |
It appears as if only node-minecraft-protocol needed to be fixed. PrismarineJS/node-minecraft-protocol#1284 Close this when that is merged. |
This is now fixed. |
Seems I closed this to early, noticed the bot continues trying to send position packets while in config state the second time. Should be a simple fix. |
Looks like the only reason its not fixed yet is that this fixed version of node-minecraft-protocol has not been pushed as a release to npm yet. |
Fix was released, there could be issues between switching states even though we only stay in the config phase for a few milliseconds (ideally). So other code might not be aware of state change and continue sending play phase packets within that time. Fixing that is going to be hard, so I'd say let's see if it causes any problems before making lots of changes to everything |
Versions
Detailed description of a problem
The bot will connect (enter a password since its an offline server) then after 30 seconds it will time out. While looking at the debug logs it appears as if it continues trying to do physics and stuff as if it was in the play state after transitioning back to the configuration to the configuration state
What did you try yet?
I haven't tried much since I just discovered the issue.
Your current code
Expected behavior
I expect the bot to join the server and stay connected. This was originally reported on the Discord and I continued investigating it.
Additional context
This is the debug log of joining the server. At the end you can notice it was told to enter the configuration state, then it starts trying to send packets that don't exist, showing that it clearly isn't transitioning properly.
log.txt
The text was updated successfully, but these errors were encountered: