mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-04-22 06:02:07 +02:00
don't check tools for digging in creative
This commit is contained in:
parent
537b1da2bc
commit
cb253f03b6
1 changed files with 7 additions and 5 deletions
|
@ -463,11 +463,13 @@ export async function breakBlockAt(bot, x, y, z) {
|
||||||
bot.pathfinder.setMovements(movements);
|
bot.pathfinder.setMovements(movements);
|
||||||
await bot.pathfinder.goto(new pf.goals.GoalNear(pos.x, pos.y, pos.z, 4));
|
await bot.pathfinder.goto(new pf.goals.GoalNear(pos.x, pos.y, pos.z, 4));
|
||||||
}
|
}
|
||||||
await bot.tool.equipForBlock(block);
|
if (bot.gameMode !== 'creative') {
|
||||||
const itemId = bot.heldItem ? bot.heldItem.type : null
|
await bot.tool.equipForBlock(block);
|
||||||
if (!block.canHarvest(itemId)) {
|
const itemId = bot.heldItem ? bot.heldItem.type : null
|
||||||
log(bot, `Don't have right tools to break ${block.name}.`);
|
if (!block.canHarvest(itemId)) {
|
||||||
return false;
|
log(bot, `Don't have right tools to break ${block.name}.`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await bot.dig(block, true);
|
await bot.dig(block, true);
|
||||||
log(bot, `Broke ${block.name} at x:${x.toFixed(1)}, y:${y.toFixed(1)}, z:${z.toFixed(1)}.`);
|
log(bot, `Broke ${block.name} at x:${x.toFixed(1)}, y:${y.toFixed(1)}, z:${z.toFixed(1)}.`);
|
||||||
|
|
Loading…
Add table
Reference in a new issue