PrismarineJS / mineflayer-collectblock

A simple utility plugin for Mineflayer that add a higher level API for collecting blocks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bot unable to break block 2 blocks above its head

octo-kumo opened this issue · comments

commented

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
Screenshot 2021-01-10 at 6 23 30 PM

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)

commented

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.

commented

Spawn protection is not a problem since the bot was able to break the bottom logs

commented

Doesnt seem to work in 1.16.1 either

Same Problem for me