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

Time suddenly speeds up 5 times for the bot #3592

Open
1 task done
IKorzI opened this issue Feb 22, 2025 · 1 comment
Open
1 task done

Time suddenly speeds up 5 times for the bot #3592

IKorzI opened this issue Feb 22, 2025 · 1 comment

Comments

@IKorzI
Copy link

IKorzI commented Feb 22, 2025

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

Versions

  • mineflayer: 4.26.0
  • server: vanilla 1.20.1
  • node: 22.11.0

Detailed description of a problem

Within 10 minutes of being on the server, the bot suddenly starts moving faster than usual. This problem does not occur every time. To fix the problem, we need to re-enter the server (bot.quit() and then mineflayer.createBot(options)).
An example of the bot's behavior is shown in the video at the link https://youtu.be/j0Rs2k_hcqg.

What did you try yet?

I checked for any acceleration effects. There is nothing like that.

Your current code

movement function

  characterMovement(direction, state) {
    switch (direction) {
      case 'forward':
        this.bot.setControlState('forward', state);
        break;
      case 'back':
        this.bot.setControlState('back', state);
        break;
      case 'left':
        this.bot.setControlState('left', state);
        break;
      case 'right':
        this.bot.setControlState('right', state);
        break;
      case 'jump':
        this.bot.setControlState('jump', state);
        break;
      case 'sneak':
        this.bot.setControlState('sneak', state);
        break;
      case 'sprint':
        this.bot.setControlState('sprint', state);
        break;
    }
  }

part of bot.on('chat') processing

      if (message === '-physics') {
        console.log(this.bot.physics)
      }

      if (message === '-come') {
        if (this.username == "_Korz_work2") {
          if (!target) {
            this.bot.chat('I don\'t see you !')
            return
          }
          const p = target.position
    
          this.bot.pathfinder.setMovements(this.defaultMove)
          this.bot.pathfinder.setGoal(new GoalNear(p.x, p.y, p.z, 1))
        }
      }

Expected behavior

The bot will move at normal speed.

Additional context

After entering "-physics" into the chat, the bot returned the following.
The values ​​are no different from those that the bot produces in a normal state without acceleration.

{
    "gravity": 0.08,
    "airdrag": 0.9800000190734863,
    "yawSpeed": 3,
    "pitchSpeed": 3,
    "playerSpeed": 0.1,
    "sprintSpeed": 0.3,
    "sneakSpeed": 0.3,
    "stepHeight": 0.6,
    "negligeableVelocity": 0.003,
    "soulsandSpeed": 0.4,
    "honeyblockSpeed": 0.4,
    "honeyblockJumpSpeed": 0.4,
    "ladderMaxSpeed": 0.15,
    "ladderClimbSpeed": 0.2,
    "playerHalfWidth": 0.3,
    "playerHeight": 1.8,
    "waterInertia": 0.8,
    "lavaInertia": 0.5,
    "liquidAcceleration": 0.02,
    "airborneInertia": 0.91,
    "airborneAcceleration": 0.02,
    "defaultSlipperiness": 0.6,
    "outOfLiquidImpulse": 0.3,
    "autojumpCooldown": 10,
    "bubbleColumnSurfaceDrag": {
        "down": 0.03,
        "maxDown": -0.9,
        "up": 0.1,
        "maxUp": 1.8
    },
    "bubbleColumnDrag": {
        "down": 0.03,
        "maxDown": -0.3,
        "up": 0.06,
        "maxUp": 0.7
    },
    "slowFalling": 0.125,
    "movementSpeedAttribute": "generic.movement_speed",
    "sprintingUUID": "662a6b8d-da3e-4c1c-8813-96ea6097278d",
    "waterGravity": 0.005,
    "lavaGravity": 0.02
}

I also noticed that the jumps happen at an increased speed. It feels like time is sped up 5 times for the bot.

@IKorzI
Copy link
Author

IKorzI commented Feb 22, 2025

While I was writing this post I had this problem again.
The video shows that walking and jumping are faster, but digging blocks is not
https://youtu.be/jimlzVZWvH0

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