Class BezierCurveMouseMovement

java.lang.Object
net.storm.api.interact.mouse.BezierCurveMouseMovement
All Implemented Interfaces:
MouseMovementStrategy

public class BezierCurveMouseMovement extends Object implements MouseMovementStrategy
Mouse movement strategy that uses quadratic Bezier curves to create natural, human-like mouse movements. The path includes a random control point to add variation and unpredictability. The path is executed across multiple client ticks.
  • Constructor Details

    • BezierCurveMouseMovement

      public BezierCurveMouseMovement(int steps, double controlPointDeviation, int pointsPerTick)
      Creates a Bezier curve mouse movement strategy.
      Parameters:
      steps - Number of points along the curve (higher = smoother)
      controlPointDeviation - How far the control point can deviate from the straight line (0.0 to 1.0)
      pointsPerTick - Number of points to execute per client tick (higher = faster)
    • BezierCurveMouseMovement

      public BezierCurveMouseMovement()
      Creates a Bezier curve with 15 steps, 0.3 deviation, and 1 point per tick.
  • Method Details

    • generatePath

      public MouseMovementStrategy.MousePath generatePath(Point current, Point target)
      Description copied from interface: MouseMovementStrategy
      Generates a mouse movement path from the current position to the target position. The path will be executed one point per client tick (or according to pointsPerTick). This method must NOT dispatch any events or block the thread - it should only generate and return the path.
      Specified by:
      generatePath in interface MouseMovementStrategy
      Parameters:
      current - The current mouse position (can be null if unknown)
      target - The target position to move to
      Returns:
      A MousePath containing the sequence of points to move through