Skip to content

Bot digging 2 times when using a tool in 1.21.4 #3618

Open
@ErneTalu

Description

@ErneTalu
  • The FAQ doesn't contain a resolution to my issue

Versions

  • mineflayer: 4.26
  • server: vanilla / 1.21.4
  • node: v20.16.0

Detailed description of a problem

When the bot mines a block with tool, it cancels digging at block's last health. Then the bot starts breaking again, but very slowly, as if it were using its hand. But there's nothing wrong if it's just use is hand, it breaks normally.

What did you try yet?

I tried all of pickaxes to stone , axe to wood and shovel to dirt. But all restarted digging again instead of hand

Your current code

/*
const Vec3 = require('vec3');

module.exports = function (bot, owner) {
  return {
    start: () => {
      dig(bot);
    }
  }
};

async function dig(bot)
{
  let blockPosition = bot.entity.position.offset(0, -1, 0);
  let block = bot.blockAt(blockPosition);

  let promise = bot.dig(block);
  await promise;
  bot.chat("Dug.");
}

*/

Expected behavior

Block should be break normally once with tools

Additional context

Forget about module exports, they have no relevance about this error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stage1just created by someone new to the project, we don't know yet if it deserves an implementation / a fpossible bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions