Changelog
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.)
- New config options:
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.nearbyHostilesarray - Linked via
gathering.init({ autoSurvival })in survival-modular.js
- New
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 functioncrash (src/modules/gathering.js)- Added Vec3 validation in
_scoreBlock()- checkstypeof blockPos.distanceTo === 'function' - Added Vec3 validation in
_findAllBlocks()- validates positions before callingbot.blockAt() - Wrapped
bot.blockAt()calls in try-catch with proper error handling - Bot no longer crashes when chunk data or positions aren't ready
- Added Vec3 validation in
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
- Removed
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 returnscol:${pos.x},${pos.z} _markFailed(pos, isTreeColumn)blacklists entire X,Z column whenisTreeColumn=true_isBlacklisted(pos, checkColumn)checks both individual blocks and columnsgatherWood()now passes{ isWood: true }to enable column blacklisting- Prevents bot from trying same unreachable tree at different Y heights
- New
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
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.
Mob awareness during gathering - Bot sometimes dies from mobs while gathering. Could pause gathering when hostile mobs are nearby.
Adaptive blacklist timeout - Currently 3 minutes fixed. Could make dynamic based on how often blocks fail.
Path cost caching -
_checkPathForHazards()recalculates for each block. Could cache results for nearby positions.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.