You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
004: full semantic parity — open container fix + eat handshake + click_slot pacing
Three remaining backlog items closed to bring Rust/accel implementation
into full behavioural parity with the Python reference.
1. open_block_container — was sending UseItem (right-click-air); now
sends BlockPlace (right-click-block / "use_item_on") with the
block position and a top-face cursor. This is the packet Python
ref sends and the only one Paper accepts to open chests/furnaces/
crafting tables.
2. eat — was a fixed 1.6 s sleep; now subscribes to clientbound
EntityStatus (id 0x1C) via the existing packet-hook mechanism,
awaits status=9 (player finished using item) matching the bot's
own entity_id, falls back to `timeout` if the server is slow.
Mirrors Python ref's async with-EntityStatus-listener pattern.
3. click_slot — was send-and-forget; now waits up to 200 ms for the
dispatcher to apply the server's SetSlot/WindowItems echo and
bump state_id. 1.20.1 has no WindowConfirmation packet — the
state_id field on every click IS the handshake. Pacing rapid
clicks against the echo prevents Paper anti-cheat desync.
Dispatcher additions to make the above work:
* SetSlot (0x14) — updates state_id + per-slot
* WindowItems (0x12) — updates state_id + bulk reload
* OpenWindow (0x30) — sets window_id + container_slots size
* CloseWindow (0x10) — clears transient state
Verification:
* cargo build -p minecraft_bot: clean.
* cargo fmt --check: clean (after `cargo fmt --all`).
* ruff check python/minecraft_bot tests: clean.
* maturin develop --release: clean.
* pytest tests/python/parity tests/python/perf -m "not live":
104 passed, 5 skipped.
* pytest tests/python/unit: 980 passed.
* cargo test --features live-smoke --test integration_bot_full:
test_state_movement_and_combat_combined green on Paper 1.20.1.
This brings 004 from "API parity" to "API + behavioural parity"
across the three artefacts. Backlog list from the previous turn:
* open_block_container — FIXED.
* eat handshake — FIXED.
* click_slot WindowConfirmation analogue — FIXED.
* entity_velocity packet — still not wired (low priority, no method
reads vx/vy/vz in 004's surface).
* Per-method packet-trace tests — still smoke-only.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments