Skip to content

Add optional head hitter sprint jumping - #5120

Merged
leijurv merged 8 commits into
cabaletta:1.21.4from
AverWasTaken:1.21.4
Sep 15, 2026
Merged

leijurv merged 8 commits into
cabaletta:1.21.4from
AverWasTaken:1.21.4

Conversation

@AverWasTaken

Copy link
Copy Markdown
Contributor

Supersedes #5105: per cbd182b the primary development branch is 1.21.4 now, so the changes were ported onto it (only real adjustment was the Mojang-mapping rename isOnGround()onGround()). The old PR closed as a side effect of the branch move and GitHub doesn't let it reopen, hence this one. clearOfLedgesAhead also now bails when the support under the next two positions isn't physically there yet, addressing the last review comment on the old PR.


New headHitters setting, off by default like other optional behavior settings.

When enabled, Baritone sprint jumps in 1x2 corridors and under any low ceiling on flat traverses. The sprint jump speed boost applies on the first ticks of the jump before we bonk our head, so hopping through a tunnel is faster than plain sprinting.

Implementation is entirely in PathExecutor.shouldSprintNextTick since that's where the sprint policy already lives. It forces Input.JUMP the same way the traverse to straight ascend skip does, and because it runs after movement.update() reasserts the inputs, the forced jump only lasts one tick so there's no state to clean up.

Some guards it has, mostly found by breaking it in game:

  • it waits until we're fully inside the corridor (same idea as skipNow) so we don't jump a block early and bonk on the face of the entrance block, which just stops us
  • no headhitting while sneaking (magma edge safety) or while the movement still has blocks to break (breaking is like 5x slower when you're jumping)
  • no headhitting when the path goes down right after the movement, or when the two blocks past the destination have no floor. The bonk momentum carries an extra block or two and will happily throw us off a ledge next to the goal
  • that ledge check originally had an off by one that crashed the client when the current movement was the last on the path, also gone now

This is execution only, the cost model is untouched (same as sprintAscends and overshootTraverse), so path choice doesn't change, we just arrive a bit sooner.

Tested in a dev env on fabric: tunnels, overhangs, goals next to dropoffs.

new headHitters setting: sprint jump in 1x2 corridors and under any
low ceiling on flat traverses. the sprint jump speed boost applies
before the head bonk, so this is faster than just sprinting.

only headhits once fully inside the corridor (so we don't bonk on
the face of the entrance block), and never while sneaking, breaking,
in water, when the path goes down right after the movement, or when
the momentum would carry us over a ledge.

(cherry picked from commit 3f43a2f)
(cherry picked from commit 1cf6a3a)
(cherry picked from commit 02849ba)
- underHeadBonkCeiling: also check the block overhead is a normal cube with
MovementHelper.isBlockNormalCube, since things like trapdoors are not fully
passable yet you can't reliably bonk against them
- clearOfLedgesAhead: require the next two movements to go in the same
direction instead of just checking for floor, so the two blocks the momentum
carries us to are always part of the path and we can never get sent off it.
this covers the path turning, ending or going down right after, and makes the
canWalkOn checks redundant since the path already guarantees those blocks
are walkable

(cherry picked from commit 5b6c3cf)
@leijurv

leijurv commented Sep 15, 2026

Copy link
Copy Markdown
Member

This looks cool. Anyone else want to give an opinion?

@AverWasTaken

Copy link
Copy Markdown
Contributor Author

#5105 zac said it was cool

@AverWasTaken

Copy link
Copy Markdown
Contributor Author

^^ removed the "Sprint jump in a 1x2 corridor" from features.md as this PR would.. well.. add it. yippe

@0alter0

0alter0 commented Sep 15, 2026

Copy link
Copy Markdown

I approve of this message

  • Lil Skittle 2026

@leijurv
leijurv merged commit 78d3613 into cabaletta:1.21.4 Sep 15, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants