Four targeted fixes for issues observed during the first live autonomous test.
What was broken
mc_stay crashed with pause undefined — Mindcraft skills assume a bot.modes API from a plugin that doesn't exist on npm.
Bot died twice to zombies at night; after respawn Pi was stuck on a stale current-task.json referencing inventory it no longer had.
No combat reflex — hostile mobs within 6 blocks did not trigger any defense; Pi only reacts after its slow reasoning loop.
mc_collect_block with count > 1 reliably timed out (270s+) even though count=1 worked in 25s. Upstream collectBlock plugin appears to drift in dense terrain after the first dig.
What this PR changes
File
Fix
extensions/lib/mcdata.js
Install no-op bot.modes shim in attachPluginsAndInit — pause/unpause/isOn/getMiningCooldown all become harmless
extensions/mineflayer-bridge.ts
New death event handler → diary line + clear current-task. spawn within 5s of death → log respawn position
extensions/mineflayer-bridge.ts
New setInterval(2s) auto-defend tick: if health <18 AND hostile within 6 blocks AND no active world task → fire bot.pvp.attack(nearest). No LLM call, sub-second reaction
extensions/mindcraft-skills.ts
mc_collect_block rewritten to loop count=1 internally, 75s per iter, abort after 3 consecutive failures, returns aggregate
Smoke test
Both extensions load. Bot connects, perception report includes hostiles nearby. No errors at startup.
What to expect after merge
Bot can be left online overnight without getting permanently stuck after a death.
Hostile mob within 6 blocks at low HP → automatic attack (no waiting for Pi to think).
mc_collect_block({blockType: "dark_oak_log", count: 8}) will now actually collect up to 8 logs (or abort cleanly with a count of how many it managed before giving up).
mc_stay, mc_consume, mc_defend_self, mc_avoid_enemies all stop crashing on bot.modes.
Four targeted fixes for issues observed during the first live autonomous test.
## What was broken
1. `mc_stay` crashed with `pause undefined` — Mindcraft skills assume a `bot.modes` API from a plugin that doesn't exist on npm.
2. Bot died twice to zombies at night; after respawn Pi was stuck on a stale `current-task.json` referencing inventory it no longer had.
3. No combat reflex — hostile mobs within 6 blocks did not trigger any defense; Pi only reacts after its slow reasoning loop.
4. `mc_collect_block` with `count > 1` reliably timed out (270s+) even though `count=1` worked in 25s. Upstream collectBlock plugin appears to drift in dense terrain after the first dig.
## What this PR changes
| File | Fix |
|---|---|
| `extensions/lib/mcdata.js` | Install no-op `bot.modes` shim in `attachPluginsAndInit` — `pause/unpause/isOn/getMiningCooldown` all become harmless |
| `extensions/mineflayer-bridge.ts` | New `death` event handler → diary line + clear current-task. `spawn` within 5s of death → log respawn position |
| `extensions/mineflayer-bridge.ts` | New `setInterval(2s)` auto-defend tick: if health <18 AND hostile within 6 blocks AND no active world task → fire `bot.pvp.attack(nearest)`. No LLM call, sub-second reaction |
| `extensions/mindcraft-skills.ts` | `mc_collect_block` rewritten to loop `count=1` internally, 75s per iter, abort after 3 consecutive failures, returns aggregate |
## Smoke test
Both extensions load. Bot connects, perception report includes hostiles nearby. No errors at startup.
## What to expect after merge
- Bot can be left online overnight without getting permanently stuck after a death.
- Hostile mob within 6 blocks at low HP → automatic attack (no waiting for Pi to think).
- `mc_collect_block({blockType: "dark_oak_log", count: 8})` will now actually collect up to 8 logs (or abort cleanly with a count of how many it managed before giving up).
- `mc_stay`, `mc_consume`, `mc_defend_self`, `mc_avoid_enemies` all stop crashing on `bot.modes`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Four targeted fixes for issues observed during the first live autonomous test.
What was broken
mc_staycrashed withpause undefined— Mindcraft skills assume abot.modesAPI from a plugin that doesn't exist on npm.current-task.jsonreferencing inventory it no longer had.mc_collect_blockwithcount > 1reliably timed out (270s+) even thoughcount=1worked in 25s. Upstream collectBlock plugin appears to drift in dense terrain after the first dig.What this PR changes
extensions/lib/mcdata.jsbot.modesshim inattachPluginsAndInit—pause/unpause/isOn/getMiningCooldownall become harmlessextensions/mineflayer-bridge.tsdeathevent handler → diary line + clear current-task.spawnwithin 5s of death → log respawn positionextensions/mineflayer-bridge.tssetInterval(2s)auto-defend tick: if health <18 AND hostile within 6 blocks AND no active world task → firebot.pvp.attack(nearest). No LLM call, sub-second reactionextensions/mindcraft-skills.tsmc_collect_blockrewritten to loopcount=1internally, 75s per iter, abort after 3 consecutive failures, returns aggregateSmoke test
Both extensions load. Bot connects, perception report includes hostiles nearby. No errors at startup.
What to expect after merge
mc_collect_block({blockType: "dark_oak_log", count: 8})will now actually collect up to 8 logs (or abort cleanly with a count of how many it managed before giving up).mc_stay,mc_consume,mc_defend_self,mc_avoid_enemiesall stop crashing onbot.modes.🤖 Generated with Claude Code