Skip to content
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

block.digTime() returns 0 on some blocks no matter with which tool. #69

Open
philipredstone opened this issue Jul 22, 2022 · 0 comments

Comments

@philipredstone
Copy link

While using mineflayer-pathfinder, i encountered a bug which is directly related to prismarine-block.

with some blocks block.digTime() returns 0, no matter which tool is used to check. currently i noticed this with 2 different blocks: copper_ore and smooth_basalt.

Steps to reproduce:

  • place copper_ore or smooth_basalt in your world
  • get the block with your bot: const block = bot.blockAt(new vec3(x, y, z), false)
function checkDigTime(block) {
    const inventory = bot.inventory.items()
    console.log(block.name+": ")
    for (const tool of inventory) {
        const digTime = block.digTime(tool ? tool.type : null, false, false, false, [], [])
        console.log(`digTime: ${digTime}, tool: ${tool.name}`)
    }
}
  • use the above function to loop over each item/tool of the bots inventory
  • no matter which tool/item, with copper_ore and smooth_basalt the digTime is 0

Output of running the function:

smooth_basalt: 
digTime: 0, tool: netherite_shovel
digTime: 0, tool: diamond_pickaxe
digTime: 0, tool: iron_pickaxe
digTime: 0, tool: golden_pickaxe
digTime: 0, tool: netherite_pickaxe
digTime: 0, tool: netherite_axe
digTime: 0, tool: stone_pickaxe
digTime: 0, tool: wooden_pickaxe


copper_ore: 
digTime: 0, tool: netherite_shovel
digTime: 0, tool: diamond_pickaxe
digTime: 0, tool: iron_pickaxe
digTime: 0, tool: golden_pickaxe
digTime: 0, tool: netherite_pickaxe
digTime: 0, tool: netherite_axe
digTime: 0, tool: stone_pickaxe
digTime: 0, tool: wooden_pickaxe

gold_ore:  (correct digTime's)
digTime: 15000, tool: netherite_shovel
digTime: 600, tool: diamond_pickaxe
digTime: 750, tool: iron_pickaxe
digTime: 1250, tool: golden_pickaxe
digTime: 500, tool: netherite_pickaxe
digTime: 15000, tool: netherite_axe
digTime: 3750, tool: stone_pickaxe
digTime: 7500, tool: wooden_pickaxe

There could be more blocks with digTime 0, but I could only find these 2 as of now.

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