moeru-ai/airi · error · ActionError

NAVIGATION_FAILED

NAVIGATION_FAILED

Error message

Could not reach crafting table

What it means

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.

Source

Thrown at integrations/minecraft/src/skills/crafting.ts:95

        if (!recipes || recipes.length === 0) {
          // If we have a crafting table but still no recipes, we are missing materials
          return false // Let the caller decide or fall through
        }
        success = await attemptCraft(recipes, craftingTable)
      }
      catch (err) {
        logger.log(
          `Attempt ${attempts + 1} to move to crafting table failed: ${(err as Error).message
          }`,
        )
        if (err instanceof ActionError)
          throw err
      }
      attempts++
    }

    if (!success) {
      throw new ActionError('NAVIGATION_FAILED', 'Could not reach crafting table')
    }

    return success
  }

  // Helper function to find and use or place a crafting table
  async function findAndUseCraftingTable(
    craftingTableRange: number,
  ): Promise<boolean> {
    let craftingTable = getNearestBlock(mineflayer, 'crafting_table', craftingTableRange)
    if (craftingTable) {
      return await moveToAndCraft(craftingTable)
    }

    logger.log(`No crafting table nearby, attempting to place one.`)
    // valid: ensureCraftingTable now throws ActionError if it fails
    await ensureCraftingTable(mineflayer)

View on GitHub (pinned to 27111382b4)

Solutions

  1. 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.
  2. Loosen pathfinder Movements (allowParkour, allowSprinting) if safe.
  3. Bridge to the table by placing blocks over gaps/liquids before retrying.
  4. Catch NAVIGATION_FAILED, switch to a self-placed table flow, and retry the craft.

Example fix

// before
await craftRecipe(mineflayer, 'stone_pickaxe', 1)

// after
try {
  await craftRecipe(mineflayer, 'stone_pickaxe', 1)
} catch (e) {
  if (e instanceof ActionError && e.code === 'NAVIGATION_FAILED') {
    // place our own table next to the bot and retry
    await ensureCraftingTable(mineflayer)
    await craftRecipe(mineflayer, 'stone_pickaxe', 1)
  } else throw e
}
Defensive patterns

Strategy: retry

Validate before calling

function isReachable(mineflayer: Mineflayer, target: Vec3, maxDistance = 32): boolean {
  return mineflayer.bot.entity.position.distanceTo(target) <= maxDistance
}

Try / catch

try {
  await craftRecipe(mineflayer, itemName, num)
} catch (e) {
  if (e instanceof ActionError && e.code === 'NAVIGATION_FAILED') {
    await ensureCraftingTable(mineflayer) // place one next to us
    await craftRecipe(mineflayer, itemName, num)
  } else throw e
}

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Related errors


AI-assisted analysis of moeru-ai/airi@27111382b4 (2026-08-12). Data as JSON: /api/errors/b127585f01132f8c. Report an issue: GitHub.