| await bot.pathfinder.goto(goal); // A very useful function. This function may change your main-hand equipment. | |
| // Following are some Goals you can use: | |
| new GoalNear(x, y, z, range); // Move the bot to a block within the specified range of the specified block. `x`, `y`, `z`, and `range` are `number` | |
| new GoalXZ(x, z); // Useful for long-range goals that don't have a specific Y level. `x` and `z` are `number` | |
| new GoalGetToBlock(x, y, z); // Not get into the block, but get directly adjacent to it. Useful for fishing, farming, filling bucket, and beds. `x`, `y`, and `z` are `number` | |
| new GoalFollow(entity, range); // Follow the specified entity within the specified range. `entity` is `Entity`, `range` is `number` | |
| new GoalPlaceBlock(position, bot.world, {}); // Position the bot in order to place a block. `position` is `Vec3` | |
| new GoalLookAtBlock(position, bot.world, {}); // Path into a position where a blockface of the block at position is visible. `position` is `Vec3` | |
| // These are other Mineflayer functions you can use: | |
| bot.isABed(bedBlock); // Return true if `bedBlock` is a bed | |
| bot.blockAt(position); // Return the block at `position`. `position` is `Vec3` | |
| // These are other Mineflayer async functions you can use: | |
| await bot.equip(item, destination); // Equip the item in the specified destination. `item` is `Item`, `destination` can only be "hand", "head", "torso", "legs", "feet", "off-hand" | |
| await bot.consume(); // Consume the item in the bot's hand. You must equip the item to consume first. Useful for eating food, drinking potions, etc. | |
| await bot.fish(); // Let bot fish. Before calling this function, you must first get to a water block and then equip a fishing rod. The bot will automatically stop fishing when it catches a fish | |
| await bot.sleep(bedBlock); // Sleep until sunrise. You must get to a bed block first | |
| await bot.activateBlock(block); // This is the same as right-clicking a block in the game. Useful for buttons, doors, etc. You must get to the block first | |
| await bot.lookAt(position); // Look at the specified position. You must go near the position before you look at it. To fill bucket with water, you must lookAt first. `position` is `Vec3` | |
| await bot.activateItem(); // This is the same as right-clicking to use the item in the bot's hand. Useful for using buckets, etc. You must equip the item to activate first | |
| await bot.useOn(entity); // This is the same as right-clicking an entity in the game. Useful for shearing sheep, equipping harnesses, etc. You must get to the entity first | |