Skip to content

bot.digTime does not take into account the enchantment on the item [1.20.5+] #3589

Open
@IKorzI

Description

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

Versions

  • mineflayer: 4.26.0
  • server: vanilla 1.20.5+
  • node: 22.11.0

Detailed description of a problem

bot.digTime returns the time it takes to break a block. The time calculation must take into account the active item, effects, enchantments, and the block to break.
In Minecraft 1.20.4 and below, everything is taken into account.
In Minecraft 1.20.5 and above, the "Efficiency" enchantment does not affect this indicator. As a result, the bot.dig function digs the block longer than necessary.

For example:

  1. A diamond pickaxe without enchantments digs a cobblestone block in 400 milliseconds. bot.digTime returns 400 milliseconds and bot.dig digs the block in 400 milliseconds.
  2. A diamond pickaxe with the "Efficiency 5" enchantment digs a cobblestone block in 100 milliseconds. bot.digTime still returns 400 milliseconds and bot.dig digs a block of 400 milliseconds instead of the required 100 milliseconds.

What did you try yet?

I used bot.dig, bot.digTime.

Your current code

const block = bot.blockAtCursor(5)
console.log(bot.digTime = ${bot.digTime(block)} ms)
...
const block = bot.blockAtCursor(5)
bot.dig(block, 'ignore', 'raycast')

Expected behavior

bot.digTime will take into account the enchantment on the item and as a result bot.dig will start working normally

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