Track the abilities the server grants - #4083
Merged
Merged
Conversation
1 task
Contributor
|
Tests more than 2x slower than master (durations are noisy, so this is informational): |
Nothing read the abilities packet, so the flight, invulnerability and speeds the server hands out were invisible and the bot kept falling through air the server had it flying in. bot.abilities holds the packet's state, entity.flying and entity.flyingSpeed carry it to prismarine-physics, and an 'abilities' event fires on each update.
u9g
force-pushed
the
feat/player-abilities
branch
from
September 12, 2026 18:00
caf2555 to
05c09e1
Compare
extremeheat
approved these changes
Sep 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1587. Half of #3274.
Nothing in
lib/reads the clientboundabilitiespacket, so the flight, invulnerability and speeds a server hands out are invisible to a bot. The visible consequence is #3274: the capture there shows a vanilla client hovering after anabilitiespacket with the flying bit while mineflayer keeps falling, and the server's anti-bot check kicks it for exactly that difference.bot.abilities—{ invulnerable, flying, mayFly, instantBuild, flyingSpeed, walkingSpeed }, starting atAbilities' own defaults (0.05/0.1) until the server sends the packet.bot.entity.flyingandbot.entity.flyingSpeedcarry the flight state to prismarine-physics, which reads them in Obey the flight the server grants in the abilities packet prismarine-physics#142. Until that is released the state is just visible, not acted on; with it the bot hovers like vanilla.abilitiesevent fires on each update.Flag bits are
ClientboundPlayerAbilitiesPacket's (1 invulnerable, 2 flying, 4 can-fly, 8 instabuild); the packet's shape is identical from 1.8 through 26.1.Test in
test/internalTest.jschecks the defaults before the packet and each field after one; it does not pass on master, wherebot.abilitiesis undefined. The 21switchWorld respawnfailures in the internal suite are already there on master.