Changelog

Last updated 3 Dec 2025, 20:47

Changelog

[2025-12-03] - Dig Retry Logic

New Features

  • Dig interruption handling (src/modules/gathering.js)
    • New config options: digMaxRetries: 3, digRetryDelay: 500
    • Modified _digBlockDirect() to retry on "aborted" or "interrupted" errors
    • Retry loop checks block state before each attempt (block may be gone after partial dig)
    • Logs retry attempts with attempt number for debugging
    • Only retries on dig interruption errors, not other failures (reach distance, etc.)

Results

  • Bot now retries dig operations that get interrupted by movement or mobs
  • Reduces "Dig failed: Digging aborted" failures during combat/movement
  • Up to 3 retries with 500ms delay between attempts

[2025-12-03] - Mob Awareness During Gathering

New Features

  • Hostile mob awareness in gathering (src/modules/gathering.js)
    • New _checkHostileThreat() method checks for hostile mobs via AutoSurvival module
    • Config options: pauseForHostiles: true, hostilePauseRadius: 12, hostileAbortRadius: 6
    • When hostile is within 6 blocks: gathering ABORTS immediately
    • When hostile is within 12 blocks: gathering PAUSES (waits up to 10 seconds for danger to pass)
    • Hostile detection uses AutoSurvival's dangers.nearbyHostiles array
    • Linked via gathering.init({ autoSurvival }) in survival-modular.js

Results

  • Bot now pauses gathering when zombies/skeletons/etc approach
  • Bot aborts gathering if hostiles get too close (within 6 blocks)
  • Reduces deaths during resource gathering phases

[2025-12-03] - Gathering Intelligence Improvements

Bug Fixes

  • Fixed pos.floored is not a function crash (src/modules/gathering.js)

    • Added Vec3 validation in _scoreBlock() - checks typeof blockPos.distanceTo === 'function'
    • Added Vec3 validation in _findAllBlocks() - validates positions before calling bot.blockAt()
    • Wrapped bot.blockAt() calls in try-catch with proper error handling
    • Bot no longer crashes when chunk data or positions aren't ready
  • Fixed failedBlocks memory being cleared each gather call (gathering.js:100)

    • Removed this.failedBlocks.clear() that was wiping memory on every _gatherBlocks() call
    • Failed blocks now remembered for 3 minutes (180000ms timeout)
    • Prevents bot from repeatedly attempting the same unreachable blocks

New Features

  • Water/lava hazard detection (_scoreBlock(), _checkPathForHazards(), _hasWaterNearby())

    • _checkPathForHazards(from, to) - raycast-style check if path crosses water/lava
    • _hasWaterNearby(pos, radius) - checks for water blocks within radius
    • Scoring penalties: -80 for water in path, -200 for lava, -60 for target over water, -30 for water nearby
  • Stronger ground-level preference (_scoreBlock())

    • +40 points for blocks at or below eye level (safest)
    • +25 points for blocks 1-2 above
    • +5 points for blocks 3-4 above
    • -50 points for blocks >6 above (dangerous)
    • -100 points for blocks >10 above (extremely dangerous)
  • Column-based blacklisting for trees (_columnKey(), _isBlacklisted(), _markFailed())

    • New _columnKey(pos) method returns col:${pos.x},${pos.z}
    • _markFailed(pos, isTreeColumn) blacklists entire X,Z column when isTreeColumn=true
    • _isBlacklisted(pos, checkColumn) checks both individual blocks and columns
    • gatherWood() now passes { isWood: true } to enable column blacklisting
    • Prevents bot from trying same unreachable tree at different Y heights

Results

  • Bot successfully gathering wood at ground level (Y=99-103 vs dangerous Y=104+)
  • No more Vec3 crashes
  • Smart target selection avoids dangerous/unreachable blocks
  • Failed block detection working - "Too many failed blocks, giving up"

Possible Future Optimizations

  1. Dig interruption handling - Many "Dig failed: Digging aborted" errors suggest dig operations are being interrupted (possibly by movement or mobs). Could add retry logic or better state management.

  2. Mob awareness during gathering - Bot sometimes dies from mobs while gathering. Could pause gathering when hostile mobs are nearby.

  3. Adaptive blacklist timeout - Currently 3 minutes fixed. Could make dynamic based on how often blocks fail.

  4. Path cost caching - _checkPathForHazards() recalculates for each block. Could cache results for nearby positions.

  5. Smarter tree detection - Instead of column blacklisting, could detect actual tree bounds and blacklist the whole tree structure.


Note: These changes are in the deployed /opt/zenpower/apps/minecraft-bot/ directory. Sync to source repository required.