Merge pull request #88 from kolbytn/break-block-fix

check creative
This commit is contained in:
Max Robinson 2024-05-18 12:08:04 -05:00 committed by GitHub
commit 89a35d3495
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -463,7 +463,7 @@ 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));
} }
if (bot.gameMode !== 'creative') { if (bot.game.gameMode !== 'creative') {
await bot.tool.equipForBlock(block); await bot.tool.equipForBlock(block);
const itemId = bot.heldItem ? bot.heldItem.type : null const itemId = bot.heldItem ? bot.heldItem.type : null
if (!block.canHarvest(itemId)) { if (!block.canHarvest(itemId)) {