Skip to content

Bot doesn't check whether it can reach the block #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
depthso opened this issue Aug 14, 2022 · 0 comments
Open

Bot doesn't check whether it can reach the block #109

depthso opened this issue Aug 14, 2022 · 0 comments

Comments

@depthso
Copy link

depthso commented Aug 14, 2022

I am creating a bot that can find a tree and mine/collect its wood but when there is a tall tree, the bot looks up and mines nothing and doesn't even bother to mine/dig blocks in front of it that obscures it.

Bot does mine blocks that are in front of it, e.g on the right or left, but doesn't when the block is upwards

const blocks = bot.findBlocks({
        matching: MinecraftData.blocksByName.oak_log.id,
        maxDistance: 64,
        count: Amount
})

if (blocks.length === 0) {
        console.log("No blocks found")
        await LookAround()
        GetWood2()
        return
}

console.log("Found Wood")

const targets = []
for (let i = 0; i < Math.min(blocks.length, Amount); i++) {
  targets.push(bot.blockAt(blocks[i]))
 }
    
try {
        await bot.collectBlock.collect(targets)
} catch (err) {
        console.log(err)
}

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant