PrismarineJS / mineflayer

Create Minecraft bots with a powerful, stable, and high level JavaScript API.
https://prismarinejs.github.io/mineflayer/
MIT License
4.89k stars 897 forks source link

The bot digs faster than the player from the launcher #1307

Closed ghost closed 3 years ago

ghost commented 4 years ago

Versions

Detailed description of a problem

The bot digs slower than from the minecraft launcher. A bot with a pickaxe enchanted for 5 efficiency, digs for 6-7 efficiency

What did you try yet?

bot.dig() bot.blockInSight() bot.canDigBlock() bot.block.At()

Your current code


if (message.body.toLowerCase() == 'копать старт') {
        const dig1 = () => {
            var target = bot.blockAt(bot.blockInSight(55, 5/16).position);
            if (target && bot.canDigBlock(target)) {
                bot.dig(target, onDiggingCompleted);
            }else{
                setTimeout(dig1, 0.0000001)
                return
            }
        };
        dig1()
        function onDiggingCompleted (err) {
                if (err) {
                    console.log(err.stack)
                    return
                    dig1()
                }else{
                    dig1()
                }
            }
}

Expected behavior

I expected normal digging speed

Additional context

Karang commented 4 years ago

This is probably the same bug as in https://github.com/PrismarineJS/prismarine-physics/pull/26

The enchantment format changed in 1.13 and we support only more recent versions. There was some plans to fix this at prismarine-item level.

ghost commented 4 years ago

This is probably the same bug as in PrismarineJS/prismarine-physics#26

The enchantment format changed in 1.13 and we support only more recent versions. There was some plans to fix this at prismarine-item level.

Or maybe I can change in the library locally? Maybe the old format remains? Or how can I fix this problem?

rom1504 commented 4 years ago

read these links and follow the proposed solution

ghost commented 4 years ago

thanks for the help!

ghost commented 4 years ago

This is probably the same bug as in PrismarineJS/prismarine-physics#26

The enchantment format changed in 1.13 and we support only more recent versions. There was some plans to fix this at prismarine-item level.

I changed the version to 1.13.2 and now a bot with an efficiency of 5 digs faster than a player with the same pickaxe

rom1504 commented 4 years ago

Feel free to investigate, the function computing this is in prismarine-block

On Wed, Sep 16, 2020, 00:35 GoldenretriverYT notifications@github.com wrote:

similiar issue for me The bot digs very slow (1.8.9 paper) - probably 3x slower than a player - callback gets triggered way too early

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/mineflayer/issues/1307#issuecomment-693015265, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437RKII2F4S7OENSQERDSF7T3VANCNFSM4RG67GDA .

ghost commented 3 years ago

@Karang Can you be more specific because of what? And in which version were the changes that slows down digging by 1.12.2 and greatly accelerates digging by 1.13, that the bot started digging with efficiency 5 as with eff 6-7

ghost commented 3 years ago

Feel free to investigate, the function computing this is in prismarine-block On Wed, Sep 16, 2020, 00:35 GoldenretriverYT @.***> wrote: similiar issue for me The bot digs very slow (1.8.9 paper) - probably 3x slower than a player - callback gets triggered way too early — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#1307 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437RKII2F4S7OENSQERDSF7T3VANCNFSM4RG67GDA .

And the haste is miscalculated? at 1.12.2?

TheDudeFromCI commented 3 years ago

This is a duplicate of #1403. More progress has been made in that thread, so I'll close this one to keep everything in one place.