{"record":{"id":"b127585f01132f8c","repo":"moeru-ai/airi","slug":"navigation-failed","errorCode":"NAVIGATION_FAILED","errorMessage":"Could not reach crafting table","messagePattern":"Could not reach crafting table","errorType":"error_code","errorClass":"ActionError","httpStatus":null,"severity":"error","filePath":"integrations/minecraft/src/skills/crafting.ts","lineNumber":95,"sourceCode":"        if (!recipes || recipes.length === 0) {\n          // If we have a crafting table but still no recipes, we are missing materials\n          return false // Let the caller decide or fall through\n        }\n        success = await attemptCraft(recipes, craftingTable)\n      }\n      catch (err) {\n        logger.log(\n          `Attempt ${attempts + 1} to move to crafting table failed: ${(err as Error).message\n          }`,\n        )\n        if (err instanceof ActionError)\n          throw err\n      }\n      attempts++\n    }\n\n    if (!success) {\n      throw new ActionError('NAVIGATION_FAILED', 'Could not reach crafting table')\n    }\n\n    return success\n  }\n\n  // Helper function to find and use or place a crafting table\n  async function findAndUseCraftingTable(\n    craftingTableRange: number,\n  ): Promise<boolean> {\n    let craftingTable = getNearestBlock(mineflayer, 'crafting_table', craftingTableRange)\n    if (craftingTable) {\n      return await moveToAndCraft(craftingTable)\n    }\n\n    logger.log(`No crafting table nearby, attempting to place one.`)\n    // valid: ensureCraftingTable now throws ActionError if it fails\n    await ensureCraftingTable(mineflayer)\n","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/moeru-ai/airi/blob/27111382b4a79a7e983289d6e983a06af185ed0f/integrations/minecraft/src/skills/crafting.ts#L77-L113","documentation":"Thrown by moveToAndCraft after maxRetries (2) failed attempts to reach and craft at a crafting table. Each attempt tries goToPosition to the table then recipesFor+craft; failures can be navigation (pathfinder cannot find a path) or craft errors that are not ActionError. ActionErrors from the inner craft are re-thrown immediately; this NAVIGATION_FAILED is reserved for repeated movement failure.","triggerScenarios":"Crafting table is on a pedestal/island the bot cannot path to (no bridge blocks); table is blocked by locked doors, fences, or claimed land; bot is stuck in a hole or against an obstacle; pathfinder movements config disallows needed behaviors (parkour/sprint disabled); server anti-cheat rubber-bands the bot.","commonSituations":"Table found in a village house behind a closed door; table on a player-built structure requiring scaffolding; server plugins blocking movement; pathfinder Movements object too restrictive (set in moveIntoRange: allowParkour=false, allowSprinting=false).","solutions":["Place a crafting table yourself in open terrain near the bot rather than relying on a distant one: await craftRecipe on 'crafting_table' first, then placeBlock.","Loosen pathfinder Movements (allowParkour, allowSprinting) if safe.","Bridge to the table by placing blocks over gaps/liquids before retrying.","Catch NAVIGATION_FAILED, switch to a self-placed table flow, and retry the craft."],"exampleFix":"// before\nawait craftRecipe(mineflayer, 'stone_pickaxe', 1)\n\n// after\ntry {\n  await craftRecipe(mineflayer, 'stone_pickaxe', 1)\n} catch (e) {\n  if (e instanceof ActionError && e.code === 'NAVIGATION_FAILED') {\n    // place our own table next to the bot and retry\n    await ensureCraftingTable(mineflayer)\n    await craftRecipe(mineflayer, 'stone_pickaxe', 1)\n  } else throw e\n}","handlingStrategy":"retry","validationCode":"function isReachable(mineflayer: Mineflayer, target: Vec3, maxDistance = 32): boolean {\n  return mineflayer.bot.entity.position.distanceTo(target) <= maxDistance\n}","typeGuard":null,"tryCatchPattern":"try {\n  await craftRecipe(mineflayer, itemName, num)\n} catch (e) {\n  if (e instanceof ActionError && e.code === 'NAVIGATION_FAILED') {\n    await ensureCraftingTable(mineflayer) // place one next to us\n    await craftRecipe(mineflayer, itemName, num)\n  } else throw e\n}","preventionTips":["Prefer a self-placed crafting table over a distant discovered one.","Loosen pathfinder Movements (allowParkour/sprint) when safe.","Bridge gaps or break obstructions before retrying navigation.","Keep a crafting_table in inventory so placement is always an option."],"tags":["minecraft","navigation","pathfinder","crafting","retry"],"backgroundTag":null,"analyzedSha":"27111382b4a79a7e983289d6e983a06af185ed0f","analyzedAt":"2026-08-12T18:33:34.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}