I am too lazy to scan for suitable place and instead, I make the bot walk right into the block he's digging. I've basically just copypasted the code from README.md:
bot.navigate.once('pathFound', function (path) {
bot.chat("Found path. I can get there in " + path.length + " moves.");
});
bot.navigate.once('cannotFind', function (closestPath) {
bot.chat("Unable to find path. getting as close as possible");
bot.navigate.walk(closestPath);
});
bot.navigate.once('arrived', function () {
bot.chat("I have arrived");
_this.prepareTool(block, function() {_this.digBlock(block);});
});
bot.navigate.once('interrupted', function() {
bot.chat("Walk interrupted at "+bot.entity.position);
_this.prepareTool(block, function() {_this.digBlock(block);});
});
bot.navigate.once('stop', function() {
bot.chat("Walk stopped at "+bot.entity.position);
_this.prepareTool(block, function() {_this.digBlock(block);});
});
bot.navigate.to(block.position);
this.bot.chat("Walking to: "+block.position);
And this is the output. As you see, stop is fired, not arrived:
I am too lazy to scan for suitable place and instead, I make the bot walk right into the block he's digging. I've basically just copypasted the code from README.md:
And this is the output. As you see,
stop
is fired, notarrived
: