0

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), <anonymous>:48:15)
    at eval (eval at compile (C:\Users\user\Desktop\MinecraftBot\node_modules\protodef\src\compiler.js:258:12), <anonymous>:2011:63) 
    at eval (eval at compile (C:\Users\user\Desktop\MinecraftBot\node_modules\protodef\src\compiler.js:258:12), <anonymous>:2098:11) 
    at Object.packet_declare_recipes (eval at compile (C:\Users\user\Desktop\MinecraftBot\node_modules\protodef\src\compiler.js:258:12), <anonymous>:2103:9)
    at eval (eval at compile (C:\Users\user\Desktop\MinecraftBot\node_modules\protodef\src\compiler.js:258:12), <anonymous>:2304:70) 
    at packet (eval at compile (C:\Users\user\Desktop\MinecraftBot\node_modules\protodef\src\compiler.js:258:12), <anonymous>: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)

I tried to put await before bot.dig, I tried to write bot.dig(block, false, "raycast") (As far as I remember I wrote this without await) 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:

async 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;
      // }



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

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

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

pppery
  • 3,731
  • 22
  • 33
  • 46
Arothron
  • 1
  • 2

0 Answers0