ghast-physics
Vanilla-exact player movement for the ghast Minecraft Java Edition client library. A pure,
deterministic function: (player state, tick input, world view) -> new state + the movement packets of the tick. No IO, no async, no clock, no mutable global state (the only static is
vanilla's constant 65536-entry sine table, built once).
| module | version | verification |
|---|---|---|
v1_8 |
1.8.9 (protocol 47; also 1.8.2 – 1.8.8) | bit-exact against the vanilla oracle (see below; 1.8.2 – 1.8.8: the same records on their jars) |
v1_12 |
1.12.2 (protocol 340; also 1.12.1) | bit-exact against the vanilla oracle (see below; 1.12.1: the same records on its jar) |
v1_16_5 |
1.16.5 (protocol 754; also 1.16.2 – 1.16.4) | bit-exact against the vanilla oracle (see below; 1.16.2 – 1.16.4: the same records on their jars) |
modern with V26_1 (feature v26_1, default) |
26.1 (protocol 775) | bit-exact against the vanilla oracle (see "Modern core") |
modern with V26_2 (feature v26_2, default) |
26.2 (protocol 776) | bit-exact against the vanilla oracle (see "26.2") |
modern with V26_3 (feature v26_3, default) |
26.3 (protocol 777) | bit-exact against the vanilla oracle (see "26.3") |
Each version module has a cargo feature of the same name (v1_8, v1_12, v1_16_5, v26_1, v26_2,
v26_3; all on by default) that also selects its ghast-data tables; any subset builds, so a client for
one version can turn the others off (default-features = false, features = ["v26_1"]). pick
needs v1_16_5, v26_1, v26_2 or v26_3.
Use
use ;
Per client tick the caller (ghast-client) does what MinecraftClient.tick does:
- apply inbound packets that arrived since the last tick, in order:
PlayerState::apply_velocity_packet(x, y, z)(raw 1/8000 units),apply_teleport(pos, yaw, pitch, relative_flags)(returns thePositionLookconfirmation the client sends immediately; it does not touchsent, like vanilla),apply_abilities(..), and plain field writes for the rest (movement_speed_basefrom entity properties,food_levelfrom update health,effectsfor jump boost / blindness);TickInput::using_itemis the client's item-use state (eating, blocking, bow) for this tick — the use / release packets themselves are sent by the client; - write this tick's actions (dig / place / click) — they are judged with
state.sent, the pose the server has; v1_8::tick(&mut state, &input, &world, &mut out)and sendoutin order.
PlayerState is Copy: clone it to plan ahead (look-ahead pathing, "where will I land") with the
same code path.
The world: BlockView
Contract: block is only called with |x|, |z| < 30_000_000 and 0 <= y < 256; it must return
states as vanilla decodes chunk data (BlockState::from_raw_vanilla: unknown ids and unregistered
metas are air) and air for columns that are not loaded (vanilla's client uses an empty chunk:
no collision; the only other effect of an unloaded column is the gravity rule below).
MemoryWorld (v1_8::memory_world()) is a simple implementation for tests, benches and tools.
Rotation helpers (rotation)
mouse_multiplier(sensitivity), mouse_step_degrees, turn(yaw, pitch, yaw_counts, pitch_counts, multiplier) reproduce the 1.8 renderer + entity angle update in whole mouse counts
(the "GCD" anti-cheats check), wrap_degrees. How many counts to move per tick (aim speed,
budgets) is client policy and stays out of this crate.
Modern core (modern, 26.1)
One core for the modern versions, generic over a modern::Rules row (the version's block tables and
constants as associated items, monomorphised: no run-time version branch). V26_1 is the first row.
The older modules stay as they are.
use ;
use ;
let mut world = memory_world_26_1; // any BlockView<State = v26_1::BlockState>
world.load_chunks;
let stone = parse.unwrap.id;
world.fill_raw;
let mut p = new;
let mut out = new;
let input = TickInput ;
;
// out: sprint entity actions / abilities, then `Packet::PlayerInput` when the keys changed, then
// at most one `Packet::Move` (position and / or rotation, on-ground, horizontal collision).
// `tick_end` is sent by the client after every tick and is not in `out`.
What the client feeds in (26.x moved much of movement to server data):
- Attributes: every
update_attributesentry for the nine movement attributes (AttributeKind::from_name) goes toPlayerState::apply_attribute(kind, base, &modifiers)in packet order (modifier ids viaModifierId::new("namespace:path"); the summation order of several modifiers follows vanilla's hash table, so the ids matter). Soul speed, depth strider, swift sneak, powder-snow frost and potion speed changes all arrive this way; the client never computes them. The client's own sprint modifier is handled byset_sprinting. - Motion:
apply_velocity(v)with the vector decoded from the packet'sLpVec3. - Teleport:
apply_teleport(pos, delta, yaw, pitch, relative_bits)(all nineRelativebits); send the returned packet afterteleport_confirm. It does not updatesent, like vanilla. - Abilities, effects (
Effects: jump boost, blindness, levitation, slow falling, dolphin's grace, weaving), food level, game mode (spectator), leather boots in the feet slot (powder snow), the item in use (TickInput::using_itemplus itsuse_effectscomponent inPlayerState::use_effects), the client options (auto_jump,sprint_window) and the level (LevelInfo: build height,fast_lava).
World contract (BlockView): positions are only asked for inside the build height of
LevelInfo; horizontal coordinates can reach about ±30,000,100. Return air for unloaded columns
and answer is_chunk_loaded truthfully: collision skips unloaded chunks, and the fluid sweep sees
no fluid when any chunk around the player's box is unloaded (vanilla 26.1 client). Gravity is
normal over unloaded columns (the 26.1 client always reports chunks as present).
Verification: tests/golden_26_1.rs replays the committed 26.1 goldens (scenarios, fuzz_seed1,
fuzz_edges_seed1, fuzz_extras_seed1); the large-fuzz test replays oracle/cache/26.1/ (4.0 M
ticks: plain, item use, edges, extras; commands in oracle/README.md, "26.1 fuzz"), 0 diffs.
26.1.1 and 26.1.2 give identical oracle records, so V26_1 covers 26.1 – 26.1.2.
Cost per tick, instructions retired (hardware counter, fixed iterations; reliable on a shared
machine) on a world shaped like ghast-world's (column_world in benches/tick.rs):
| scenario | modern | 1.16.5 | 1.8.9 |
|---|---|---|---|
| walk on flat stone | 34.2 k | 55.8 k | 8.7 k |
| busy collision | 39.3 k | 68.5 k | 9.5 k |
| swim | 24.6 k | 35.4 k | — |
Wall clock (modern_tick, 2026-11-11, machine shared with other builds, ±15 %): walk 3.3 µs
hash-map world / 2.4 µs dense world, busy 3.9 / 2.7 µs, swim 2.4 / 1.8 µs (1.16.5: 5.4 / 3.2,
6.2 / 4.1, 3.3 / 2.2 µs). The ghast-world-shaped world costs the same instructions as a dense
array, so the world accessor is not the hot spot; about half the tick is the ~250 block lookups
vanilla's queries make.
Unloaded chunks: the caller must not tick the player before its level is loaded (26.1's
player_loaded gate); "never treat unloaded chunks as air" is enforced in the client, one layer up.
Gliding (elytra) and firework rockets: PlayerExt + tick_ext (module docs of modern::PlayerExt
say what the client must feed: the server's shared entity flags, the equipped glider, attached
rockets). The glide reads Math.cos(pitch); HotSpot x86-64's intrinsic is not correctly rounded,
so modern::jdk_math reproduces it (correctly rounded cosine + a 44,355-entry exception table
generated from the JVM; another JVM platform, e.g. aarch64, may differ in the last bit). Not
modelled there: a rocket that hits a big dripleaf tilts it on the client before the server does.
Riptide: modern::riptide (the client's launch on releasing the trident), in_water_or_rain,
the spin counter and pose in PlayerExt; touching other entities while spinning is not modelled.
Other entities: Surroundings + tick_in (boxes of boats, rafts, shulkers the player collides
with, in the level's getEntities order), push_by after each entity's client tick
(push_kind_26_1, collides_26_1).
World border: BorderState (the client's lerping border, ticked after the entities;
collision_border for the world view), both-sided bound clamp and the degenerate-border shape.
Boats: Boat + tick_boat (module docs of modern::Boat give the tick order and what the client
feeds and sends: set_passengers -> Boat::board, move_vehicle -> Boat::server_move, the boat's
entity colliders). Bubble columns: a boat in a column is pushed client-side (modelled); on top of
one the server drives it (26.1 / 26.2: it moves the boat; 26.3: entity events 71 / 72 ->
Boat::bubble_column_event). Both are covered only by the cached boats-bubble oracle fuzz (no
golden file). Two passengers (Boat::set_passengers): the first steers and sits 0.2 forward,
the other 0.6 back; a boat the player rides behind someone else follows the entity tracker's
interpolation (Boat::follow_tracker, server_teleport, server_on_ground, server_snap),
does not move by itself, keeps its turn speed until 26.3 (26.3 stops it, and steers only for a
player in front: set_front_not_player), and the passenger's yaw stays clamped to 105 degrees
of it (boats_seat.jsonl.gz, 6 hand + 4 fuzz cases, and boats-seat-fuzz seed 2, 200,000
ticks, on each of 26.1, 26.2 and 26.3, 0 diffs). A boat the player steers while
an interpolation runs (boarded while the server moved it, taken over from the back seat, a
teleport-entity) takes the tracker's step before paddling and sends the interpolation's target in
vehicle_move (Boat::set_interpolation_target; proven through the engine,
mounts_board_moving.jsonl.gz). Not modelled: the paddle entity data of a boat another player
paddles (the paddles' animation and sounds only).
Minecarts (vehicles the server moves): Seat + tick_passenger (the vehicle's position after its
own client tick comes from the entity tracker).
Pistons (modern::piston::{v26_1, v26_2, v26_3}): Pistons::block_event runs the client's piston on a
block-event packet (PistonBaseBlock.triggerEvent: PistonStructureResolver, moving-piston blocks
in the level's ticker order, a block entity replacing a live one at the same position taking over
its slot, the client's shape updates of the writes); tick_player_among_pistons is the player's
tick among the moving blocks' shapes (vanilla's re-simplified joins: the piston's own parts from the
piston_shapes dump, moved blocks built and checked against the 2,448-shape moving_shapes dump);
Pistons::tick_after_entities / tick_after_entities_among tick the moving blocks after every
entity: 0.5 per tick, pushes by overlap + 0.01 with the piston move type (0.51 per axis per game
tick, no stuck multiplier, no edge back-off, the move's block effects at once), slime velocity,
honey drag, retracting heads pulling back, the 5-tick client hold, placement; the other entities'
client copies move too (PistonEntity, per-type entity_facts from the oracle). Shape updates are
modelled for fences, bars / panes, walls, stairs, fence gates, snowy blocks, carpets, dead corals and
mushroom blocks; other classes that change state on the client are reported by
Pistons::take_unmodelled. Oracle: pistons.jsonl.gz (206 cases, 9,118 ticks) and 10,000 cached
cases / 1,000,000 ticks per version at 0 diffs, the other entities' boxes compared every tick.
Riding a living mount (modern::{Mount, MountKind, tick_mount}; module docs of modern::Mount):
horse, donkey, mule, skeleton and zombie horse. Saddled (a donkey's or mule's saddle counts only
when it is tame) the rider controls it and the client moves it: the rider's input of its previous
tick, the jump bar and start_riding_jump, rearing and its seat offset, a step height of at least
one block, floating while ridden (not the skeleton horse), the mount's own water slowdown, the
non-player fluid current; unsaddled the server moves it. A mount the player left keeps slowing down
and is pushed off the player (Mount::tick_alone). mounts.jsonl.gz (14 hand cases + 60 fuzz
cases, 5,883 ticks) and mounts-fuzz seed 2 in fuzz-mounts/ (200,000 ticks) on each of 26.1,
26.2 and 26.3, 0 diffs.
Pigs and striders (MountKind::Pig, Strider; mount_steer.rs): saddled, and steered while the
rider holds a carrot / warped fungus on a stick in either hand (Mount::set_rider_sticks), they
always walk forward, turned to the rider, at the movement speed × 0.225 (pig) or × 0.55 (strider,
× 0.35 while cold) times the boost factor of the server's boost time (Mount::set_boost_time). A
strider stands on lava sources (their collision is the bottom half), travels as on land in lava,
floats up, takes no fall distance in lava, is cold out of lava (the client's own −34 % speed
modifier) and bobs its rider with its walk animation. Camels and camel husks (Camel,
CamelHusk; mount_camel.rs): the horse path with the camel's rules — the jump bar is a dash
along the look with a 55-tick cooldown, the rider can sprint it (+0.1), it sits and stands up
against the level's game time (Mount::set_game_time, the pose and LAST_POSE_CHANGE_TICK from
entity data): no move while sitting or changing pose, the forward key stands it up, water at
once; its sitting box, the seat that follows the sitting animation. mounts_steer.jsonl.gz (18
hand + 2 fuzz cases, 1,423 ticks) and mounts_camel.jsonl.gz (10 hand + 4 fuzz cases, 1,381
ticks), with mounts-steer-fuzz / mounts-camel-fuzz seed 2 in fuzz-mounts-steer/ and
fuzz-mounts-camel/ (200,000 ticks each) on each of 26.1, 26.2 and 26.3, 0 diffs. Not modelled
there: baby pigs, striders and camels (a second camel passenger, the bot as the camel's back
seat, is covered by the passenger seats below), an uncontrolled strider's walk animation from the server's moves (its seat bob).
The happy ghast (HappyGhast; mount_fly.rs): steered by its first passenger while it wears a
harness (any item in its body slot) and the server does not keep it still (STAYS_STILL,
Mount::set_stays_still). It flies: the rider's sideways key, forward / back along the rider's
pitch, the jump key up, scaled by 3.9 × flying_speed; it turns 8 % of the way to the rider per
tick; no gravity, 0.91 (air) / 0.8 (water) / 0.5 (lava) of the motion kept, no fall distance. Four
seats (Mount::set_seat: the player's passenger index; only the first one steers). An unridden
adult ghast is solid for a player whose feet are at or above its top, or while it is kept still
(happy_ghast_collides, for the caller's entity boxes). The nautilus and zombie nautilus
(Nautilus, ZombieNautilus; mount_swim.rs): steered when tame and saddled; the rider's pitch
steers it up and down; in water it travels at the movement speed × 0.0325 keeping 0.9 of its
motion (no gravity), on land and in lava like a living entity at × 0.02; water does not push it;
the jump bar is a dash along the rider's look (× 1.2 in water, × 0.5 out of it) with a 40-tick
cooldown (the server's DASH flag too, Mount::set_dash). mounts_ghast.jsonl.gz (14 hand + 5
fuzz cases, 1,353 ticks) and mounts_nautilus.jsonl.gz (11 hand + 5 fuzz cases, 1,248 ticks),
with mounts-ghast-fuzz / mounts-nautilus-fuzz seed 2 in fuzz-mounts-ghast/ and
fuzz-mounts-nautilus/ (200,000 ticks each) on each of 26.1, 26.2 and 26.3, 0 diffs. Not
modelled there: baby ghasts and nautili, a happy ghast's collision with another ghast or with a
player that crosses its top within one tick, the rider's breathing effect (server-side).
Passenger seats and boarding (mount_seat.rs): only the first passenger steers
(Mount::set_seat, set_passenger_count); a camel seats a second passenger 0.7 back at the
back's anchor height. A mount the player rides but does not steer follows the entity tracker's
interpolation (Mount::follow_tracker: 26.1 / 26.2 in aiStep after the base tick, 26.3 in
commonTick before the tick; no slowdown while it interpolates), takes a teleport's motion
and ground flag (server_teleport, the supporting block found at once) and snaps past 64
blocks (server_snap, position_passenger); a mount with passengers is not pushed off the
player. Hand-overs both ways (the player becomes the first passenger, someone is put in front
of it). At the boarding: a camel's or nautilus' dash cooldown run on from the server's DASH
(Mount::dash_synced, dash_clock, set_dash_state; none before the entity's first tick),
an entity the client has ticked (mark_ticked), a pig or strider boost started before the
boarding (it does not tick while nobody steers). mounts_seat.jsonl.gz (6 hand + 4 fuzz
cases), mounts_board.jsonl.gz (8 cases) and mounts-seat-fuzz seed 2 (200,000 ticks) on
each of 26.1, 26.2 and 26.3, 0 diffs.
A mount the client watched before the boarding starts from its client copy's state
(Mount::set_watched_state, Boat::set_watched_state: its own motion, the server's last motion
or teleport delta slowed on the ticks without an interpolation and cut under 0.003, pushed by
the player, and the last position packet's ground flag; mounts_wander.jsonl.gz, through the
engine). The player keeps its rotation at the boarding: the horse's turn of its rider runs on
the server only (mounts_board_yaw.jsonl.gz). Not modelled: llamas and ravagers (not steered
by players), baby mounts and a mount's scale attribute, an unridden strider in lava and fluid
currents on an unridden mount (for the watched state). A mount the player steers while an interpolation runs (boarded or taken over while the
server moved it, a teleport-entity of it) follows the tracker's step before the rider's travel
(follow_tracker with was, the tracker kept on the client's moves) and sends the target in
vehicle_move (Mount::set_interpolation_target): proven through the engine only
(mounts_board_moving.jsonl.gz, 9 cases on each 26.x version, the interpolation being the
tracker's; the physics replay has no tracker and does not replay that file).
Not modelled: block entities other than moving pistons. The nether's fast_lava
(LevelInfo) and build height are oracle-proven (nether.jsonl.gz).
Known gap, shulker boxes: an opening shulker box collides past its cube (the lid follows the
block entity); the tables hold the closed box. The client push-out probe also relies on every
suffocating large shape staying inside its cube — pinned by the ghast-data test
suffocating_large_shapes_stay_in_their_cube, which fails if the data ever changes that.
26.2 (V26_2)
V26_2 is the 26.1 row over the 26.2 tables with one structural change, Rules::RESTITUTION
(26.2 Entity.restituteMovementAfterCollisions): each colliding axis becomes -v * restitution
(the bounciness attribute, default 0, so a plain collision leaves a signed zero); on landing
the larger of that and the block's bounce restitution (slime block 1, beds 0.75, ×0.8 for a
boat), none when falling slower than the effective gravity, while sneaking or on honey
(suppresses_bounce); the vertical rebound compensates gravity and air drag for the part of the
tick after the impact. friction_modifier and air_drag_modifier scale the block friction and
the air drags (computeModifiedFriction). The three attributes live in
PlayerExt::attributes (MovementAttributes::get_mut(name) + Attribute::apply_packet); the
plain tick uses their defaults, which give the 26.1 arithmetic bit for bit.
Verification: tests/golden_26_2.rs (all 26.2 movement goldens, incl. fuzz_restitution_seed1
and 20 restitution scenarios) and the large-fuzz test over oracle/cache/26.2/ (16.2 M ticks at
0 diffs: plain 4.2 M, edges, extras, restitution and each extension mechanic 1 M, plus 1 M of
the entities fuzz around a player scaled up to 16; 26.1 has the same scaled run). Known
approximation: vanilla's process-wide fluid shape cache (FlowingFluid.getShape keeps the height
of the first block it was built for, so a long-lived client may clip a water source as a full
block). ghast behaves as a freshly started client and computes the height per query; this
affects the fall-distance raycast (fall_distance) and, in a real long-lived client, whether a
use-item fluid ray (bucket, bottle, lily pad, boat item, spawn egg) grazing the top ninth of a
source cell hits. Idle slime and bed drops (slime_drop_*_long 6–30 blocks, a drift case,
bed_drop_20_long) are proven to the end of the bounce tail, including the landing ticks whose
move is below the position threshold (the real client then sends only the on-ground flag). tests/family_26_2_on_26_1.rs (ignored) replays 26.2 vectors on
the 26.1 tables by state name, the measurement that put 26.2 into the 26.1 family.
Instructions per plain tick (hardware counter, 40,000 ticks, memory world; walk / busy / swim): 26.1 41,751 / 45,590 / 30,287; 26.2 41,824 / 45,639 / 30,289.
26.3 (V26_3)
V26_3 is the 26.2 row over the 26.3 tables plus the rule items marked 26.3 on Rules: the
teleport confirm carries the pose and no position packet follows; the movement packet is sent
after the other entities and moving blocks ticked; the liquid scan uses a closed interval; a
landing bounces only above gravity; eyes-in-fluid uses the camera height; signs block fluid
flow and no longer block motion; bounce is a block property (the shelf mushroom bounces, the
straw bed does not); no glide start in lava.
Verification (2026-11-27): tests/golden_26_3.rs replays every committed 26.3 movement golden
at 0 diffs, and the large-fuzz test over oracle/cache/26.3/ is 0 diffs over 17.2 M ticks
(182,000 cases: plain + item use, edges, extras, restitution, teleports, elytra incl. lava,
riptide, entities, nether, world border, boats incl. bubble columns, minecarts, pistons).
Crosshair pick (pick: 1.8.9, 1.12.2, 1.16.5, 26.1, 26.2, 26.3)
1.8.9 / 1.12.2 (pick::v1_8, pick::v1_12, shared pick::legacy): eye_position, look_vector
(1.8: pass the head yaw; 1.12: the body yaw), pick(world, eye, look, reach) (block or the
last skipped block as a miss, None otherwise), clip(world, start, end, liquids, return_last),
and pick_target(world, eye, look, creative, player_bb, entities) →
legacy::Target::{None, Block, Entity, TooFar}. Proven: 2000 + 2000 raytrace.jsonl.gz rays, all
5161 1.12.2 selection entries, 3200 + 3200 committed and 120k + 120k cached picks.jsonl.gz
picks (random worlds of every state, ~74k entity targets) bit-identical.
1.16.5 / 26.1: which block, face and exact point the look ray hits, or which entity — the target the server
judges a dig, place or attack against. One shared implementation of vanilla's block traversal,
VoxelShape.clip (inside test on the grid, then the boxes in vanilla's order), the interaction-shape
face override and the entity loop (ProjectileUtil); 1.16.5 and 26.1 run identical code there. The
version modules add the eye, look vector, ranges and per-state shapes (ghast-data
BlockState::outline_shape / outline_shape_holding_own_item / outline_offset /
interaction_shape (26.1) / raycast_shape (1.16.5)):
use ;
let eye = eye_position;
let view = view_vector;
match pick_target
entities are the pickable ones (no spectators, no items / orbs / arrows), in the world's iteration
order; that order only decides between overlapping boxes around the eye. 1.16.5:
v1_16_5::pick_target(world, bb, eye, look, creative, held_block, entities) (reach 4.5 / 5.0, entity
reach 3 / 6). pick / clip are the block-only parts.
Verified against both oracles: 3200 + 3200 committed viewpoints (tests/pick.rs) and 200k cached
ones per version (feature oracle-cache), random worlds of all states (partial shapes, offset
plants, scaffolding / light held-item outlines, cauldron / hopper / composter interaction shapes)
with entities: 0 diffs in location bits, block, face, inside flag and entity. Not covered: fluid
picks, 26.1 attack-range items (spears), multipart entities, riding (same_root_vehicle is
implemented but has no oracle vector), block-entity outlines (shulker boxes, moving pistons).
Other moving entities (projectiles, items, orbs, TNT, falling blocks)
Each version module has the same three modules: projectile (Projectile, ProjectileKind,
tick_projectile returning the tick's block hit, run_projectile), drop (Drop, DropKind:
item entities, experience orbs, primed TNT, falling blocks; tick_drop, run_drop) and
launch (the exact launch of thrown / shot projectiles with the server's random spread
separated, item drops). Each tick runs as the server (Side::Server, what really happens) or as
a client shows the entity between server updates (Side::Client).
1.8.9 (v1_8) |
1.12.2 (v1_12) |
1.16.5 (v1_16_5) |
26.x (modern) |
|
|---|---|---|---|---|
| Kinds | snowball, egg, ender pearl, bottle o' enchanting, splash potion, arrow, small / large fireball, wither skull, bobber, item, orb, TNT, falling block | + lingering potion, tipped / spectral arrow, dragon fireball | + trident | + wind charge |
| Golden cases (both sides) | 157 | 168 | 188 | 165 each |
| Launch lines | 450 | 500 | 500 | 400 each |
| Cached fuzz, entity ticks, 0 diffs | 1.16 M | 1.15 M | 1.16 M | 1.10 M each |
Version details the vectors pin down: 1.8.9's thrown items, arrows and the bobber turn with
atan2 * 180.0 / π (two roundings, the later versions multiply by one folded constant), its
bobber has no flying / bobbing states (it floats by the part of its box in water and sticks in a
block for one tick only), and brewing stands and end portal frames ray-test their shared block
bounds (the full cube until a collision scan of the entity sets them to the item-render box);
1.12.2 records the arrow's hit with a float offset and resets a non-finite position after the
update (an arrow that hits the point it starts from); 1.16.5 uses voxel-shape rays, applies
the bubble column, honey and cobweb effects to projectiles, and pushes items twice per tick
through water. Item drop spreads read the JVM's Math.cos / Math.sin intrinsics, which are
not correctly rounded (and Rust's f64::cos / f64::sin are the platform's libm): every
version takes them from jdk_trig, a double-double reference corrected by a table taken from
HotSpot x86-64 itself for all 2^24 angles a nextFloat() can make (41,175 one-ulp exceptions;
JDK 21 and 25, interpreted or compiled, give the same values). Every golden drop line matches
bit for bit. A server on another JVM (Java 8's intrinsics were different code) or another
architecture may still differ by one unit (not checked).
An orb follows the nearest player within 8 blocks (tick_drop_near with the players as
orb::OrbPlayers: position, eye height, spectator and, on 26.x, dead flags; the client
oracle's orb cases prove it with the client's sim on all six versions).
Not covered: entity hits, piercing, merging, pickup, trident
loyalty, explosion pushes (the server's large fireball removal tick includes its own
explosion's push: only removed is compared there), the server's bite logic while bobbing,
where a landing falling block places its block (and block updates it causes: one cached 1.8.9
case, a falling anvil whose start block's removal drops unsupported trapdoors, is listed as
known in tests/projectiles_cache.rs), unloaded chunks, portals, the world border.
Client copies (26.x): a Projectile / Drop kept for a tracked entity follows the server's
packets through setters that keep the rest of the state (set_pos, set_vel,
set_rotation, set_on_ground, an arrow's set_in_ground, set_acceleration_power,
set_dangerous, set_fuse); set_interpolation_start gives the next tick the old position
and rotation a client takes before its commonTick interpolation step (orbs, bobbers), and
moved_last_tick lists the tick's Entity.move moves (26.3's recordMovement). ghast-client
runs them for every tracked entity with Interests::ENTITY_PHYSICS, proven against the real
client under random entity packets (tests/golden/<v>/nonliving_tracking.jsonl.gz).
Client copies (1.16.5): Projectile::{set_pos, set_vel, set_rotation, set_on_ground, set_dangerous, set_tipped, set_no_gravity}, set_velocity_client (a velocity packet:
ProjectileEntity.setVelocityClient turns a fresh projectile to its motion, an arrow's timer
restarts), skip_tick (the world resets the previous position and rotation of an entity in a
loaded column not yet filed in its chunk, without its tick); Drop::{set_pos, set_vel, set_on_ground, set_fuse, set_no_gravity, set_fire_immune}. Proven the same way
(tests/golden/1.16.5/nonliving_tracking.jsonl.gz). 1.12.2: the same setters (no
set_fire_immune); its set_velocity_client turns only a fresh thrown item or arrow (an
arrow also rebuilds its box and restarts its timer), hurting projectiles and the bobber take
the motion only (tests/golden/1.12.2/nonliving_tracking.jsonl.gz). 1.8.9:
Projectile::{set_pos, set_vel, set_rotation, set_on_ground, set_velocity_client, skip_tick, set_dangerous}, Drop::{set_pos, set_vel, set_on_ground}, and set_tracked_position on
both (updateTrackedPositionAndAngles: the push-up onto the block boxes the box runs into,
an arrow's plain move, a fishing bobber's 3-step interpolation, which its tick then runs
instead of its physics; tests/golden/1.8.9/nonliving_tracking.jsonl.gz).
Design decisions
- Version rules are modules, selected at compile time.
v1_8has its ownPlayerState, block rules andtick.Ruleset(implemented byv1_8::V1_8) lets the client be generic over versions with static dispatch; nothing on the hot path is dynamic. 1.16.5 will be a sibling module with its own state type (sneaking/swimming poses differ) behind the same trait. - Exactness first, structure our own. Each step keeps vanilla's precision (
f32vsf64, widening points,int + floatproducing a float, truncation vs floor, JavaMath.min/maxzero-sign rules,Vec3d's-0.0 -> 0.0, NaN behaviour of negated comparisons). The code is organised in our own way (one context struct, shared sweep helpers, geometric stairs and door rules), not a transliteration. - Collision shapes: static shapes come from
ghast-data; this crate adds what a table cannot express: neighbour-dependent fences, panes, walls, stairs (outer/inner corners) and doors (each half reads the other half's metadata). - History-dependent shapes are an option. 1.8.9 anvils, chests and trapped chests collide
with whatever bounds the last shape update of any block of that type left behind.
v1_8::Options { history_shapes }selectsHistoryShapes::Settled(default, project policy: anvil by facing, chest extended towards the first same-kind chest north/south/west/east — what Grim models) orConstructor(anvil full cube, single-chest inset — what a fresh client and the oracle's movement harness have).tickuses the default;tick_withtakes options. The golden and fuzz replays run withConstructor; the box-dump tests checkSettledagainst every"settled"line andConstructoragainst the rest. - Block data from
ghast-data: static shapes are placed withCollision::world_boxes, which reproduces vanilla'sfloatworld-coordinate boxes (cactus, cake, fence gates; soul sand and snow only on y) and the sorting box constructor; per-block flags (full cube, full block, render as normal block, material identity and blocks-movement / solid / fluid / opaque) come fromBlock::vanilla()/Block::material(). A unit test checks the derived predicates (incl. the fence/wall connection rule) against the oracle dump. - Collision queries fill a small inline box list (no allocation unless a query finds more than 24 boxes); emptiness checks (sneak edge guard, liquid jump-out) stop at the first box. Every query updates the world-border flag exactly as vanilla's does.
- Packets come out as a fixed-capacity
Packetslist in send order.
Vanilla behaviours worth knowing (all verified)
- Tick order: water contact (flow push 0.014) → lava halves fall distance → sprint timer → input (sneak ×0.3) → push out of blocks (4 probes at minY + 0.5) → sprint (double tap within 7 ticks, sprint key, stop on forward < 0.8 / horizontal collision / food ≤ 6) → creative flight double tap → fly up/down impulse → velocity cut-off (|v| < 0.005) → jump (0.42, +0.1 per jump boost level, sprint +0.2 along yaw; water/lava +0.04) → input ×0.98 → travel → air acceleration for the next tick (0.02 / 0.026 sprinting: sprint changes reach the air one tick late) → landing ends flight → x/z clamp ±29,999,999 → packets.
- Travel: ground acceleration
attr * 0.16277136 / f³withf = slipperiness * 0.91of the block at(floor x, floor minY − 1, floor z); ladders/vines clamp to ±0.15, stop descent while sneaking, climb 0.2 on horizontal collision; water drag 0.8, lava 0.5, jump out at a ledge 0.3. - Gravity −0.08 ×0.98; when the column at
((int) x, (int) z)(truncation) is not loaded the player instead getsvelY = −0.1(0 at y ≤ 0). - Move: cobweb (×0.25 / ×0.05, velocity zeroed), sneak edge guard in 0.05 steps, clip Y→X→Z, step-up 0.6 (two candidate paths), slime bounce / slime walking ×(0.4 + |vy|·0.2), soul sand ×0.4 per contained block, fall distance, landing re-checks water.
- Outside the world border (default ±29,999,984) blocks collide as stone while the player is inside it.
- Movement packet: position when moved² > 9e-4 or every 20 ticks, rotation when the float difference is non-zero; sprint/sneak entity actions before it; flight toggles send abilities.
1.12.2 (v1_12): what changed since 1.8.9
v1_12 has the structure of v1_8 (same calling convention, PlayerState is Copy) and is the
first member of the 1.9 – 1.12 family. Everything below is verified against the vanilla 1.12.2
oracle (tests/golden/1.12.2/, oracle/README.md "1.12.2"):
- Ticking: the client only ticks a player its world has added to a chunk: a player spawned
above a column that is not loaded neither moves nor sends anything until the column arrives
(
PlayerState::added_to_chunk); once added it keeps ticking over unloaded columns, falling at −0.1 there (the column test floors x / z; 1.8 truncated). - Constants: velocity cut-off 0.003 (1.8: 0.005); input acceleration converts the yaw with
one
floatmultiply (yaw * 0.017453292F) and has a (zero) vertical component, which turns a-0.0vertical velocity into+0.0. - Sneaking: the edge guard probes one step height (0.6) down instead of one block, so a sneaking player walks down half-block drops; after the move the box becomes 0.6 × 1.65 while sneaking (1.8 when not) if the new box is free, rebuilt from its minimum corner; the step effects (slime walking) are skipped when the player is sneaking on the ground after the move.
- Flying: sneaking no longer slows horizontal flight (the input is divided by 0.3 again); flight resets the fall distance.
- Effects / blocks: levitation replaces gravity (
vy += (0.05 · (amp + 1) − vy) · 0.2); beds bounce (vy = −vy · 0.66Funless sneaking); an open trapdoor above a ladder with the same facing is climbable. - Collision query: one block wider on x / z (corner columns and the top layer of edge columns skipped); no validity filter on columns, so the size check counts columns beyond ±30,000,000 as colliding. Axes with a zero offset are not clipped or moved.
- Fluids: every material query iterates
floor(min) .. ceil(max); falling water pulls down next to a solid face (by the 1.12 face shape, stairs and the attach exclusion list excepted). - Shapes (
blocks.rs): no history-dependent shapes; fences are a post plus one box per arm and connect by the neighbour's face shape (same material or a gate for fence posts), panes a post plus arms, walls one box; doors read the other half's decoded properties when it is the same door (a half whose metadata does not carry a property has the palette's hidden default: the last value — facing east, closed, right hinge); chests reach towards a chest of the same kind; chorus plants grow arms towards chorus blocks (and end stone below). - Other entities (
entity.rs, new in 1.9 – 1.12 on the client): living entities (not bats, parrots, armor stands or the ender dragon), other players and boats push the local player from their own client ticks (tickCramming; only the main player is pushable on the client), withMathHelper.sqrt(double)'sfloatroot; boats push only when the player's feet are not above the boat's bottom, over the boat's box grown by 0.2 and shrunk by 0.01 vertically (push_by,push_kind). Boats and live shulkers are solid for the player's move, step-up, sneak edge guard and jump-out test (tick_inwith their boxes;collides). A boat's tick breaks the lily pads it touches in the client's world (lily_pads_broken_by_boat). Team rules, spectator pushers, the entities' client positions (interpolation) and their tick order are the caller's (ghast-clientdoes them). - Packets: a bare on-ground packet only when
on_groundchanged (no idle packets), the position refresh on the 20th tick; teleports clamp x / z to ±3e7 and the pitch to ±90 and are answered withteleport_confirm(sent by the client crate) thenposition_look. - Auto-jump is not modelled (bots never auto-jump; the oracle runs with it off).
Verification
cargo test runs:
tests/golden.rs: every committed vector —tests/golden/1.8.9/scenarios.jsonl.gz(80 cases, 3,245 ticks, incl. 4 item-use cases) andfuzz_seed1.jsonl.gz(100 × 60 = 6,000 ticks). Interaction packets in the records (block_place/block_digof item use) are the client crate's and are not compared. Every recorded state field (position, box, velocity, all flags, timers, speeds, input,sentbookkeeping, the derivedtouching_lava/climbing) and every packet is compared by its bits; the tick-0 record must round-trip too. A mismatch prints case, first differing tick, field path, expected and actual (hex + decimal). Result: 0 diffs.src/v1_8/tests.rs: all 4,442 lines ofcollision_boxes.jsonl.gz(every id × meta alone and in the dumped neighbour configurations, the 184 "settled" lines withSettled, the rest withConstructor) produce exactly the oracle's boxes; all 9,648collision_boxes_far.jsonl.gzlines (absolute boxes at three far positions, incl. just past 2^24) match too — this caught the float-built cake box whose rounded min exceeds its max there (vanilla's box constructor sorts); the block-flag table equals the dump's block lines.math: the sine table's bit hash equals the one a JDK builds.
Large fuzz (feature oracle-cache, reads the git-ignored oracle/cache/1.8.9/fuzz/*.jsonl.gz or
$GHAST_FUZZ):
for; do # add --use-item true for item-use spans
done
for; do # wider palette: doors, chests, anvils, liquids, events, item use
done
Extras fuzz (server speed modifiers of every operation incl. negative ones, depth strider,
spectator no-clip): oracle/run.sh fuzz --extras true --seed S --count 2000 --ticks 100 --out "$PWD/oracle/cache/1.8.9/fuzz-extras/extras_sS.jsonl.gz"; seeds 41-45 = 1,000,000 ticks, 0 diffs.
Edge fuzz (partial-height blocks next to each other and to full blocks, landing step-ups):
oracle/run.sh fuzz --edges true --seed S --count 2000 --ticks 100 --out "$PWD/oracle/cache/1.8.9/fuzz-edges/edges_sS.jsonl.gz"; seeds 31-35 = 1,000,000 ticks, 0 diffs
(about 320 landing step-ups per 200k ticks). The committed fuzz_edges_seed1.jsonl.gz and the
landing_step_* scenarios cover the case a live Grim test raised.
Riding a boat (v1_8::{Boat, tick_boat, tick_boat_with}; module docs of v1_8::Boat): the 1.8
client simulates the boat its player rides (buoyancy over five slices, the rider's forward input
along its yaw, the 0.35 cap and the growing speed factor, snow layers and lily pads removed, a
move without step-up, the yaw turned towards the motion with 1.8's table atan2), then the
rider's own tick (look + steer_vehicle) and the seat. 1.8 never leaves the rider's own vehicle
out of doesBoxCollide (it compares the entity list, not its entries): the rider collides with
its boat's box and the boat with its rider's. The server's teleport, relative move and velocity of
the boat are Boat::server_*. The boat calls Math.sin / Math.cos, whose last bit depends on
the JVM (58 of 29,340 values in the golden file differ from the correctly rounded ones on HotSpot
21 x86-64): tick_boat uses the platform's functions, tick_boat_with takes a JavaTrig, and the
replay feeds the oracle's recorded values. boats.jsonl.gz (18 hand cases + 100 fuzz cases) and
fuzz --boats true seeds 81-85 in fuzz-boats/ (1,000,000 ticks), 0 diffs. Other entities near
the boat are not modelled on 1.8.9 (as for walking). Sitting in a minecart (v1_8::{Minecart, tick_minecart}): the server moves it; the client interpolates its teleports (within 1/32 the
position is kept) and relative moves on its 1/32 server position (3 + 2 steps), the rider's own
tick (a minecart has no box for its rider, unlike a 1.8 boat), look + steer_vehicle, the seat
0.35 below; no dismount by the client: minecarts.jsonl.gz (7 hand cases + 100 fuzz cases) and
fuzz --minecarts true seeds 91-95 in fuzz-minecarts/ (1,000,000 ticks), 0 diffs. Riding a
living mount (v1_8::{Mount, JumpBar, tick_mount}: horse, donkey, mule, zombie and skeleton horse,
pig): the 1.8 client never moves a living mob, it interpolates the server's positions (3 steps; a
teleport within 1/32 keeps the position); a saddled horse turns with its rider (yaw, half the
pitch), the body follows (BodyControl), rearing (horse flag 64) lifts the seat and moves it along
the body yaw; the rider's own tick (no box for its rider), look + steer_vehicle, and on a
saddled horse the jump bar (JumpBar, kept by the caller across rides) with its riding-jump
action when the jump key is let go; the seat height × 0.75 - 0.35 above. A rider never takes
the flying travel (PlayerEntity.travel). mounts.jsonl.gz (19 hand cases + 60 fuzz cases) and
fuzz --mounts true seeds 71-75 in fuzz-mounts/ (1,000,000 ticks), 0 diffs. A mob the client
only watches is the same Mount ticked without a rider (Mount::tick(None)): boarding a mob the
server walked for 1 – 40 ticks, mounts_board.jsonl.gz (24 fuzz cases) and fuzz --mount-boards true seed 91 in fuzz-mount-boards/ (300,000 ticks), 0 diffs. Not modelled: baby
mounts, other mobs as mounts (spiders, chickens and the rest need their own seat offsets).
Last run (2026-11-03): 24,000 cases, 2,160,000 ticks, 0 diffs (oracle fuzz 1,000,000 ticks,
oracle fuzz with --use-item true 200,000 ticks (seed 21), extra fuzz 960,000 ticks; per 160k extra ticks about 14k in water with flow, 4.5k in lava, 7k in
cobweb, 21k flying, 1.8k outside the border, 1,100 teleports, 1,300 abilities and 2,400 velocity
events; seeds 4-6 add item use and origins at ±2^24).
1.16.5: MC=1.16.5 oracle/run.sh fuzz --seed S --count 2000 --ticks 100 --out "$PWD/oracle/cache/1.16.5/fuzz/physics_sS.jsonl.gz"; seeds 11-15 = 1,000,000 ticks, 0 diffs (plus the
committed tests/golden/1.16.5/ scenarios and fuzz_seed1, replayed by tests/golden_1_16_5.rs).
The dimension type (PlayerExt::ultrawarm + tick_ext; vanilla Entity.updateWaterState: lava
pushes with 0.007 instead of 0.0023333333333333335 in an ultrawarm dimension, the nether; nothing
else in the 1.16.5 player's movement reads the dimension type): nether.jsonl.gz (8 hand cases
- 100 fuzz cases, 6,329 ticks) and
fuzz --nether trueseeds 51-55 infuzz-nether/(1,000,000 ticks), 0 diffs. Riptide (riptide— the client's launch on releasing the trident —,in_water_or_rain,PlayerExt::{spin_attack, riptide_ticks},Surroundings::othersfor the spin's contacts, the spin pose asPose::FallFlying, the same box):riptide.jsonl.gz(18 hand cases + 100 fuzz cases, 6,799 ticks) andfuzz --riptide trueseeds 61-65 infuzz-riptide/(1,000,000 ticks), 0 diffs. The use state (10-tick minimum, the 4-tick retry, refusal out of water and rain) is the caller's, as are the rain (gradient, biome, sky light) and the list of other entities. Gliding (PlayerExt::{fall_flying, elytra, glide_pose}+tick_ext,apply_shared_flags,rocket_boostonce per attached rocket in the client world's tick order; module docs ofv1_16_5::PlayerExt):elytra.jsonl.gz(29 hand cases + 100 fuzz cases) andfuzz --elytra trueseeds 71-75 infuzz-elytra/(1,000,000 ticks), 0 diffs. Which rockets tick, and before or after the player, is the caller's (the iteration order of the client world's entity map; a rocket ticks while its chunk is loaded). Riding a boat (Boat,tick_boat; module docs ofv1_16_5::Boat): the turn clamp, the boat's tick (location, fluid push, floating, paddling, move without step-up, block effects), the passenger tick (no water contact, no swimming, no auto-jump, no item slowdown, no flight) withlook+steer_vehicle+vehicle_move, the seat, the client's own dismount on sneak:boats.jsonl.gz(14 hand cases + 100 fuzz cases) andfuzz --boats trueseeds 81-85 infuzz-boats/(1,000,000 ticks), 0 diffs.state_collidesand the boat's land friction useVoxelShapes.matchesAnywhereexactly (overlaps under 1e-7 do not count). Sitting in a minecart (Minecart,tick_minecart; module docs ofv1_16_5::Minecart): the server moves a minecart (novehicle_move); the client's part is the cart's interpolation (a position packet's 3 steps + 2, its own 1/4096 tracked position for relative moves), the passenger tick (it touches water, unlike a boat's),look+steer_vehicle, the seat 0.35 below the cart and the client's own dismount on sneak:minecarts.jsonl.gz(8 hand cases + 100 fuzz cases) andfuzz --minecarts trueseeds 91-95 infuzz-minecarts/(1,000,000 ticks), 0 diffs. Riding a living mount (Mount,MountKind,tick_mount; module docs ofv1_16_5::Mount): the client moves the horse family (not llamas), a pig while the rider holds a carrot on a stick and a strider while it holds a warped fungus on a stick: the mount's travel with the rider's input of the previous tick (horse: sideways ×0.5, backwards ×0.25, speed attribute, jump strength × bar × block factor, rearing; pig / strider: the rider's look, saddled speed, boosts; strider: lava walking, floating, cold), step height 1, the walk animation,vehicle_moveand the answer to the server's; any other mount is interpolated (3 steps). The rider's jump bar sendsentity_actionstart riding jump.mounts.jsonl.gz(24 hand cases + 100 fuzz cases) andfuzz --mounts trueseeds 81-85 infuzz-mounts/(500,000 ticks), 0 diffs. A mount the client only watches (Mount::watched,tick_watched,board/leave): the mob's client tick without a rider (interpolation step or ×0.98 decay, the 0.003 cut-off, head-yaw interpolationserver_head_yaw, fluid pushes, walk animation, body turn, rearing from the server's horse flagsserver_horse_flags), the spawn packet's float velocity (spawn_velocity) and the mob's own push when it touches the player (push_by_with,Mount::pushed_player, halved with a strider's floating):mounts_board.jsonl.gz(16 fuzz cases: watched 1 – 40 ticks, then ridden; stick changes mid-ride) andfuzz --mount-boards trueseed 91 infuzz-mount-boards/(300,000 ticks), 0 diffs; the server's dismount of a horse or pig with a placement above the ground,mounts_dismounts.jsonl.gz(28 cases), 0 diffs. Not modelled: baby mounts, the mount's status effects, other entities colliding with it, a horse rearing at random (its ambient sound, the client's unseeded random).
1.12.2: tests/golden_1_12_2.rs replays the committed tests/golden/1.12.2/ scenarios (122 cases),
fuzz_seed1, fuzz_edges_seed1 and entities (23 hand cases + 60 fuzz cases with other entities,
4,506 ticks); src/v1_12/tests.rs checks every line of the 1.12.2 collision
dumps (6,083 box lines incl. neighbour configurations, 12,192 far lines) and the stairs face shapes.
Large fuzz: the same commands with MC=1.12.2 and oracle/cache/1.12.2/ (seeds 11-15, 21 with
--use-item true, extra 1-6 replayed from fuzz-in/, edges 31-35, extras 41-45) = 4,160,000 ticks,
0 diffs; entities (fuzz --entities true, seeds 51-60 in fuzz-entities/) 2,000,000 ticks, 0
diffs. Gliding (v1_12::PlayerExt + tick_ext, apply_shared_flags, rocket_boost after the
tick once per attached rocket; the 1.12 client only asks with start_fall_flying, the server's
flag 7 starts the glide): elytra.jsonl.gz (25 hand cases + 100 fuzz cases) and
fuzz --elytra true seeds 71-75 in fuzz-elytra/ (1,000,000 ticks), 0 diffs. Riding a boat
(v1_12::{Boat, tick_boat}; module docs of v1_12::Boat): the turn clamp, the boat's tick
(location, water flow push, floating, paddling with the previous tick's keys, steer_boat, a
move without step-up, block effects twice, lily pads broken), the passenger tick (no water
contact, no item slowdown, no flight) with look + steer_vehicle + vehicle_move, the seat.
The 1.12 client never dismounts by itself (sneak only reaches the server in steer_vehicle).
What blocks the boat: blocks_boat + entity_climbing. Sitting in a minecart (v1_12::{Minecart, tick_minecart}): the server moves it; the client interpolates its teleports (a teleport within
1/32 only turns it) and relative moves on its 1/4096 server position (steps + 2), the passenger
tick touches water (only a boat's passenger does not), look + steer_vehicle, the seat 0.35
below; no dismount by the client: minecarts.jsonl.gz (7 hand cases + 100 fuzz cases) and
fuzz --minecarts true seeds 91-95 in fuzz-minecarts/ (1,000,000 ticks), 0 diffs. boats.jsonl.gz (22 hand cases + 100
fuzz cases) and fuzz --boats true seeds 81-85 in fuzz-boats/ (1,000,000 ticks), 0 diffs.
Riding a living mount (v1_12::{Mount, MountKind, RiderJump, tick_mount}; module docs of
v1_12::Mount): the client moves the horse family but the llama, and a pig while a hand holds a
carrot on a stick (MobEntity.method_13003). Such a mount skips the server's interpolation, decays
its velocity ×0.98, travels with the rider's input of the last tick (horses: sideways ×0.5,
backwards ×0.25, only with the saddle bit; a steered pig always forward at speed × 0.225 plus its
boost), step height 1.0 (an unsteered pig 0.5), turns its body (BodyControl) and rears; the
rider's tick charges a saddled horse's jump bar (start_riding_jump with bar × 100 on release, the
horse then rears and jumps with jump strength × power) and sends look + steer_vehicle +
vehicle_move. A llama or an unsteered pig follows the server's moves (3-step interpolation on
its 1/4096 server position). Seats per kind (horse family height × 0.75, chested horses − 0.25,
skeleton horse − 0.1875, a rearing horse forward and up; llama height × 0.67 and 0.3 forward along
its body yaw; pig height × 0.75). mounts.jsonl.gz (25 hand cases + 80 fuzz cases, 8,630 ticks)
and fuzz --mounts true seed 7 in fuzz-mounts/ (1,500,000 ticks), 0 diffs. A mount the client
only watches (Mount::watched, tick_watched, board / leave, server_velocity,
pushed_player with push_by_with): mounts_board.jsonl.gz (16 fuzz cases) and fuzz --mount-boards true seed 91 in fuzz-mount-boards/ (300,000 ticks), the server's dismount with a
placement above the ground mounts_dismounts.jsonl.gz (28 cases), 0 diffs. Not modelled: baby
mounts, a mount's own random rearing (its ambient sound draws from the client's unseeded entity
random), dying mounts (health 0), other mobs as mounts.
Total randomized oracle fuzz: 9,320,000 ticks, 0 diffs — 1.8.9 4,160,000 (the 2,160,000 above, 1,000,000 extras, 1,000,000 edges), 1.12.2 4,160,000 and 1.16.5 1,000,000.
Performance
cargo bench -p ghast-physics (x86-64 WSL2, release + fat LTO), per tick, 20-tick sequences:
| case | MemoryWorld (hash per column) |
dense array world |
|---|---|---|
| walk on flat stone | 1.2–1.5 µs | 0.43–0.67 µs |
| busy: sneak on a ledge edge into fences / panes / wall / stairs / slabs under a ceiling, jumping | 1.4–1.7 µs | ~0.54 µs |
(Ranges over several runs on a machine shared with other builds.)
With the real ghast-world worlds (palette sections, hashed columns; measured 2026-11-04 with a
small standalone harness that builds both worlds through their chunk-data API):
| case | 1.8.9 | 1.16.5 before | 1.16.5 after |
|---|---|---|---|
| walk on flat stone | ~0.55-0.58 µs | 6.2 µs | ~2.8 µs |
| busy collision case | ~0.65-0.69 µs | 8.3 µs | ~4.8 µs |
1.16.5 is dearer by design: vanilla's collision scan covers a one-block ring around every query box (fences and walls reach into neighbouring cells), and a tick runs several queries (pose checks, push-out probes, the sweep). What made it cheaper without changing a single result:
- a per-tick 8x8x8 block memo around the player and a 3x3 chunk-loaded memo (
TickCache, both versions); - a per-state collision summary byte (empty / full cube / exceeds cube / moving piston) that rejects most cells with one table read;
- the shapes of a sweep are collected once and reused for all three axes, as vanilla's reusable stream does;
- nested pose boxes (0.6 < 1.5 < 1.8 high, same feet) answer each other, so the pose checks usually cost one query, and the four push-out probes share per-column answers;
- the shape/box overlap test runs on a stack buffer and skips vanilla's redundant separation pre-check.
Even the 1.16.5 busy case at ~5 µs per tick is 0.01 % of a core per bot at 20 tps.
Not covered yet (open)
Done since earlier versions of this list: speed modifiers of every operation (attribute::Modifiers,
vanilla's hash order), depth strider, spectators, entity pushes and collisions (1.12.2, 1.16.5,
26.x), riptide (1.16.5, 26.x), the moving world border (26.x BorderState), boats (1.8.9,
1.12.2, 1.16.5, 26.x), minecarts (26.x), gliding (elytra) and rockets (1.12.2, 1.16.5, 26.x),
two boat passengers and boats the player does not control (1.12.2, 1.16.5: Boat::set_seat,
tests/golden/<v>/boats_seat.jsonl.gz), dismount placements (1.8.9, 1.12.2, 1.16.5:
dismounts.jsonl.gz), living mounts on every version (sections above), boarding from the
state of the client's copy of a watched mount (every version), other moving entities' own
physics on every version ({v1_8, v1_12, v1_16_5, modern}::{projectile, drop, launch}:
projectiles, item entities, experience orbs, primed TNT, falling blocks;
tests/golden/<v>/projectiles.jsonl.gz, projectile_launch.jsonl.gz).
- 1.8.9: no client-side entity pushes (the 1.8 client leaves them to the server) and boats / minecarts are not solid for the player's move.
- Riding a vehicle other than a boat, a minecart or a living mount (1.12.2, 1.16.5), or other than a boat, a minecart, a horse kind or a pig (1.8.9); bubble columns under a 1.16.5 boat; other entities near a 1.8.9 boat.
- Sleeping: ghast-client puts the player on the bed as each client does and keeps it still, but the movement step keeps the standing box (the 0.2 × 0.2 sleeping box is not simulated); portals / nausea.
- Which entity a projectile hits (the server's decision), and the rest listed under "Other moving entities".
- Server-side corrections are the client's job (teleports), not this crate's.
- (Covered since 0.4.6.) Below y = −64 the client player keeps ticking on every version (vanilla hurts a living entity
there instead of removing it, and the client player refuses the damage). 1.8.9 and 1.12.2
stopped the tick there before 0.4.6 (
PlayerState::removed, now only the caller's); 1.8.9: scenariosvoid_fall,void_fall_creativeand the cachedfuzz-void/slice (1,000fuzz-extrascases moved to y −58…−68 and replayed, 100,000 ticks, 80 % below −64, 0 diffs).