mineflayer-navigate

mineflayer plugin which adds 3d pathfinding

mineflayer-navigate

A library to help your mineflayer bot navigate around the 3D world using the A* algorithm.

See https://github.com/superjoe30/mineflayer/

var mineflayer = require('mineflayer');
var navigatePlugin = require('mineflayer-navigate')(mineflayer);
var bot = mineflayer.createBot({ username: 'Player' });
// install the plugin 
navigatePlugin(bot);
bot.on('chat', function(usernamemessage) {
  // navigate to whoever talks 
  if (username === bot.username) return;
  var target = bot.players[username].entity;
  if (message === 'come') {
    bot.navigate.to(target.position);
  } else if (message === 'stop') {
    bot.navigate.stop();
  }
});

Finds a path to the specified location and goes there.

  • point - the block you want your feet to be standing on
  • options - optional parameters which come with sensible defaults
    • isEnd - function(node) - passed on to the A* library. node.point is a vec3 instance.
    • endRadius - used for default isEnd. Effectively defaults to 0.
    • timeout - passed on to the A* library. Default 10 seconds.

Aborts an in progress navigation job.

Emitted from bot.navigate when a partial path is found. path is an array of nodes.

Emitted from bot.navigate when a complete path is found. path is an array of nodes.

Emitted when a path cannot be found.

Emitted when the destination is reached.

Emitted when navigation has been aborted.