mineflayer-collectblock
mineflayer-collectblock copied to clipboard
Bot unable to break block 2 blocks above its head
In this scenario, the bot is trying to chop trees, and it will get stuck on the block 2 blocks above its head. I have checked the logs, the block the bot is looking at (and feed into collect block) is the correct block.
- version: 1.12.2 (no questioning why I'm still on 1.12)
code:
collect(accepts: number[]): Promise<any> | boolean {
if (limit < 1) return false;
const target = this.bot.findBlock({
matching: accepts,
maxDistance: 64
});
if (target) {
this.log('collecting', target.name, target.position.toString());
return new Promise((resolve, reject) => this.bot.collectBlock.collect(target, (err) => {
if (err) reject(err);
else resolve(target);
}));
} else return false;
}
plz support promises thks
Is there any error printed to the console?
Is the callback called?
Can you confirm the bot has permission to break the block? (I.e. not in spawn protection)
There are no errors and the callback was never called, since behind this function is a infinite recursion, if it returned it would call the same function again. I will need to test with a barebones one later.
Spawn protection is not a problem since the bot was able to break the bottom logs
Doesnt seem to work in 1.16.1 either
Same Problem for me