-
Notifications
You must be signed in to change notification settings - Fork 2
Safety Net en
Whatever the upper layers decide, AIBot runs a per-tick safety net that keeps the bot from needlessly dying. This is key to it feeling "alive".
Scheduled by BotTickCoordinator in a fixed order. Whichever layer takes over short-circuits the tick (later layers don't run):
① NavSafetyNet → ② StuckWatcher → ③ DangerWatcher → ④ GoalExecutor → ⑤ IdleCoordinator
survival anti-stuck fight/flee/avoid advance goal autonomy
- Suffocation: stuck in blocks → climb up to the surface (fixes "rescue digs it deeper").
- Lava: standing in / on lava → escape immediately.
- Drowning: underwater and low on air → surface to breathe; if sealed in with no air, emergency-teleport to the nearest breathable spot.
Within watchdog.stuckWindowTicks, if position, task progress and inventory total are all unchanged, it declares a stuck and aborts the task, handing back to the upper layer to re-plan.
Stationary tasks (mining / descending) opt out via
isWaiting()and rely on their own watchdog — avoiding false kills while working. See Task System.
-
Threat detection:
collectTopThreatscans nearby hostiles with line-of-sight / block-occlusion checks (no "fighting through a wall" false positives). -
Fight or flee:
decideCombatOrEvadeweighs HP and enemy count (combat.retreatHp/maxEnemiesToFight). - Light the dark: place torches when light is too low, reducing spawns at the source.
-
Dark-trap escape:
maybeEscapeDarkTrapretreats to the surface when swarmed; the goal is kept so the bot resumes the unfinished task afterward (no "amnesia on retreat").
With no danger, advance the next step of the current Goal Engine; re-plan on failure.
With no goal or task, the bot decides what to do (organize, patrol, stand by) instead of freezing.
-
Dig-move circuit breaker: the moment
MoveTaskdigs the bot underwater (drowning) or into a mob pit (taking hits), it abandons the move and hands off to the safety net — never digging all the way to death. -
Staircase descent:
DescendToYTask/DigDownTaskalways dig diagonally down, avoiding water / lava below — never straight down into a void. - No teleporting, no bunny-hopping: walking only taps jump once, when grounded and a real step / gap is ahead.
Further reading: Architecture · Task System · Configuration (tuning thresholds)
AIBot · GitHub · MIT License · LLM plans · Tasks execute · Bob survives
新手上路
理解原理
参与开发
- Home
- Getting Started
- Commands
- Configuration
- Client Panel
- Architecture
- Goal Engine
- Task System
- Brain & Tools
- Safety Net
- Developer Guide
- FAQ
主仓库 · MIT