-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Disable physics during configuration packet #3722
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
base: master
Are you sure you want to change the base?
Disable physics during configuration packet #3722
Conversation
Omena0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Tests fail I think we should rather disable a lot more than specifically physics during configuration phases And it would be best to add a test for this (probably an internal test), so it will keep working |
Those seem like flaky tests to me. They don't have anything to do with this pr |
|
Could this be merged? |
|
No please see my previous message on what still needs to be done here |
The tests that failed did not seem related at all to the PR, as Omena0 said above. |
Could you please try re-running the tests that failed? |
This is the main point |
Yeah, I get that's the main point, but this PR shouldn't be blocked for it. This solves a real issue that's affecting me and other users right now. If more things should be disabled, we can make a separate, more detailed issue for that. We shouldn't hold up this fix expecting the author to do it all here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds handling for Minecraft's configuration phase by listening to start_configuration and finish_configuration events to control physics state during server configuration.
- Disables physics when entering configuration phase
- Re-enables physics when exiting configuration phase
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| bot._client.on('finish_configuration', () => { shouldUsePhysics = true }) | ||
|
|
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unconditionally setting shouldUsePhysics = true after finish_configuration may enable physics before the 'position' packet is received. The existing pattern (line 420) only enables physics after receiving the position packet to ensure the player position is properly initialized. Consider removing this line and relying on the 'position' packet handler to re-enable physics at the appropriate time.
| bot._client.on('finish_configuration', () => { shouldUsePhysics = true }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like good point @bmstefanski ? Position should be returned by server after entering play state
I've found that connecting to a server with minecraft version
1.20.4didn't work - throwing quite ambiguous errorAn internal error occurred in your connection, but after trying different things for a while I figured it works well on1.20and only some servers throw that error. I compared the packet trace between those two versions and one difference I found was that in 1.20.4, servers sendstart_configurationpackets during gameplay to reconfigure clients, but mineflayer's physics plugin was missing handlers for this. The bot continued sending position packets while in configuration state, which is invalid and causes the server to kick the client