Going further
Path finding
After this page you can send a bot somewhere, from a plain Behavior or from the
ext helpers, and you know which moves it makes and where it stops.
Turning it on
The pathfinder feature adds ghast::pathfinder (the ghast-pathfinder crate). With ext
on as well, Bot::goto and Bot::follow_path appear. It works on every supported version:
1.8.9, 1.12.2, 1.16.5, 26.1, 26.2 and 26.3.
= { = "0.5", = ["ext", "pathfinder"] }
How it plans
The planner is an A* over feet blocks (the block the player's feet are in). Its costs are
ticks measured, not guessed: Costs::of(version) runs each move type once in the
vanilla-exact physics on canonical terrain.
Before the bot moves, the follower runs the whole path through that physics with the same controller that will drive the bot, and plans around any move the simulation fails. Gap jumps get one more check: standing on the take-off block, the controller simulates the jump from its actual state in the actual world and jumps only if it lands.
The moves it knows:
| move | what |
|---|---|
| walk, diagonal | step-ups and drops up to 0.6 (slabs, soul sand, carpets); diagonals need both side columns clear and floored |
| ascend, descend | jump onto a block 0.6 to 1.0 higher; fall at most max_fall (3: no damage) or into deep water |
| parkour | jumps along an axis over 1 to 3 blocks level, one up, one or two down (4 when two down) |
| swim, climb | water up, down and out; ladders and vines |
| door | right-click a closed wooden door, fence gate or trapdoor and walk through (never iron doors) |
| dig, place (opt-in) | tunnel, dig down, staircase down; fill holes, bridge gaps, tower up |
Unloaded blocks are impassable, never air: a goal beyond them gives a partial path to the loaded edge (see World and entities). Lava, fire, cobwebs, berry bushes, portals and magma or cactus floors are avoided.
From ext
bot.goto.await?;
bot.goto_with.await?;
if let Some = bot.player.await?
The goals are Block([x, y, z]), Near { pos, radius }, Xz { x, z } (any height),
Y(y) and AnyOf(goals) (the nearest reachable one). goto fails with Error::NoPath when
no path exists and Error::Stuck after too many replans. follow_path stays within range
blocks of an entity and needs Interests::ENTITIES.
From a plain Behavior
Follower drives a path from Behavior::tick, acting only through the TickContext (aim,
keys, the left button, place), so every rule of the tick model holds.
;
let mut f = new;
f.goto;
The follower replans after a teleport, when it gets stuck or leaves the path (that move is avoided from then on), and at the end of a partial path. A long plan is spread over ticks: at most 2000 nodes and 5 ms of planning per tick by default. Meanwhile the bot stands still and the client keeps sending its movement packet.
Tuning
let pf = new;
let follower = new;
Config (planner): with_sprint, with_parkour, with_swim, with_climb (all on),
with_max_fall (3), with_dig (a DigCost), with_place (ticks per block; keep blocks in
hand), with_max_nodes (250,000) and with_heuristic_weight (1 is optimal; more plans
faster, slightly longer). FollowConfig (follower): with_budget, with_max_replans (8),
with_verify (on), with_verify_ticks (400) and with_movement_only, which leaves the aim to
your behaviour, for a fight that keeps looking at its target.
What it costs
On x86-64 WSL, release, 1.8.9 (2026-11-06): about 400 to 480 k nodes per second. A straight 100-block walk on flat ground plans in 0.28 ms; a detour around a long wall on rolling terrain expands 27,091 nodes in 57 ms, which the follower spreads over about 19 ticks (about 1 s of standing still). A 127-block maze at view distance 10 plans in 67 ticks, worst tick 6.1 ms. The controller costs about 6 to 14 µs per tick.
In the labs, Paper with the Grim anticheat, the course runs (step-ups, water, soul sand, ice, gap jumps, a 31-block maze and following an armor stand) gave 0 Grim flags on 1.8, 1.12, 1.16, 26.1 and 26.3, and 0 setbacks where setbacks were counted (1.8 to 26.1).
Limits today
- Gap jumps go along the four axes only, from and onto full-height floors with ordinary friction. Sprint jumps need food above 6; otherwise the follower plans around them.
- Not modelled: entities in the way, flight, boats, 1.16 sprint-swimming, and speed or slowness effects in the costs.
- On 26.x the move set follows the player's attributes at plan start, but move costs stay vanilla's, and attributes that change during the walk are seen only by the controller.
- Trapdoors are opened only to walk through them, not as hatches over ladders.
- When the goal cannot be reached through the loaded terrain, the follower walks to the
reachable block closest to it and fails with
NoPathafter that one search.