Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var mineflayer = require('mineflayer');
var vec3 = mineflayer.vec3;
var navigatePlugin = require('mineflayer-navigate')(mineflayer);
var voxelPlugin = require('./mineflayer-voxel.js')(mineflayer);
var bot = mineflayer.createBot();
navigatePlugin(bot);
voxelPlugin(bot, {port: 13333});
bot.navigate.on('pathPartFound', function (path) {
bot.chat("Going " + path.length + " meters in the general direction for now.");
});
bot.navigate.on('pathFound', function (path) {
bot.chat("I can get there in " + path.length + " moves.");
});
bot.navigate.on('cannotFind', function () {
bot.chat("unable to find path");
});