PrismarineJS / mineflayer

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

The mineflayer bot breaks blocks endlessly on a specific minecraft server. #2778

Open Arothrone opened 1 year ago

Arothrone commented 1 year ago

Versions

Detailed description of a problem

I want my bot not to dig blocks endlessly on the mc.mstnw.net minecraft server. I expected that the bot will dig blocks like in the local world, but after he breaks 2-3 blocks normally, he starts digging them endlessly, after that it is kicked by anti-cheat for "Breaking blocks too fast." reason. When my bot enters the server, this error message appears in the console, which does not seem to affect anything: PartialReadError: Read error for undefined : Missing characters in string, found size is 41224 expected size was 3325017 at new ExtendableError (C:\Users\user\Desktop\MinecraftBot\node_modules\protodef\src\utils.js:63:13) at new PartialReadError (C:\Users\user\Desktop\MinecraftBot\node_modules\protodef\src\utils.js:70:5) at Object.string (eval at compile (C:\Users\user\Desktop\MinecraftBot\node_modules\protodef\src\compiler.js:258:12), :48:15) at eval (eval at compile (C:\Users\user\Desktop\MinecraftBot\node_modules\protodef\src\compiler.js:258:12), :2011:63) at eval (eval at compile (C:\Users\user\Desktop\MinecraftBot\node_modules\protodef\src\compiler.js:258:12), :2098:11) at Object.packet_declare_recipes (eval at compile (C:\Users\user\Desktop\MinecraftBot\node_modules\protodef\src\compiler.js:258:12), :2103:9) at eval (eval at compile (C:\Users\user\Desktop\MinecraftBot\node_modules\protodef\src\compiler.js:258:12), :2304:70) at packet (eval at compile (C:\Users\user\Desktop\MinecraftBot\node_modules\protodef\src\compiler.js:258:12), :2322:9) at CompiledProtodef.read (C:\Users\user\Desktop\MinecraftBot\node_modules\protodef\src\compiler.js:70:12) at e.message (C:\Users\user\Desktop\MinecraftBot\node_modules\protodef\src\compiler.js:111:49)

What did you try yet?

I tried to put await before bot.dig, I tried to write bot.dig(block, 'raycast', 'raycast') instead of bot.dig(block), I tried adding 50, 100, and 1000ms to block.digtime. I tried to break the grass by the bot, and the he also breaks it endlessly, but he does not get kicked, and after 5 seconds he finally breaks it and goes to the next one. I break grass instantly (Not bot). I also want to clarify that when I checked the grass breaking bot, I noticed that the id of the tallgrass is different than in mineflayer. Here is some of my code:

Your current code

/* function functionName(nullblock=null) { // if (toolSel() == false) { // bot.chat('/msg SomeCringeyName No pickaxe.') // return; // } // notair(distance) // if (hine == true) { // pos()

for (let p = 1; p >= 0; p--) { if (bot.blockAt(new Vec3(x, y+p, z-distance)).name != 'air') { block = bot.blockAt(new Vec3(x, y+p, z-distance));

  // if (nullblock != null && block != null) {

  //   if (nullblock.position.z == block.position.z && nullblock.position.y == block.position.y && cringe != true) {
  //     setTimeout(function() {
  //       fuc()
  //     }, 18000)
  //     return;
  //   }
  //   cringe = false;
  //   tempblock = nullblock;
  // }

  bot.dig(block, 'raycast', 'raycast')
  // if (p == 0) {
  //   let hahah = Math.round(bot.digTime(block)*5)

  //   setTimeout(function() {
  //     if (bot.targetDigBlock != null) {
  //       bot.stopDigging()
  //     }
  //     fuc()
  //   }, hahah)
  //   return;
  // } else {
  //   fuc()
  // }
  setTimeout(function() {
    // start functionName if it passes a lot of checks.
    fuc()
  }, bot.digTime(block)+2000)
  return;
}

} }

*/



## Expected behavior
I expected the bot to break blocks at a normal speed, not endlessly.

## Additional context
I also want to add that when I looked at the bot through the mineflayer-viewer, there was nothing unusual, such as flying armour-stands or something like that.

Here is a video demonstrating the problem: https://www.youtube.com/watch?v=Aox5-rq4V4s&ab_channel=Arothron

Old post on stackoverflow (https://stackoverflow.com/questions/73800045/how-to-make-the-mineflayer-bot-not-break-blocks-endlessly-on-a-specific-minecraf)
a-a-afk commented 1 year ago

At this point you might as well just get cheats for it, since you're trying to bypass an anticheat.

Arothrone commented 1 year ago

At this point you might as well just get cheats for it, since you're trying to bypass an anticheat.

Hello. Could you give me a link to an article on how to do this or tell me about it here, please? Unless it was sarcasm, of course. If this is not possible, I will close the issue.

extremeheat commented 1 year ago

What server is this on?

Lierx commented 9 months ago

i got the same error, how i can just supress it?