Class RangedKitingGoal

java.lang.Object
net.minecraft.world.entity.ai.goal.Goal
com.binaris.wizardry.content.entity.goal.RangedKitingGoal

public class RangedKitingGoal extends net.minecraft.world.entity.ai.goal.Goal
Intelligent kiting goal for ranged attack entities that maintains a safe distance. Just controls the movement directly without using pathfinding (avoiding the look modifications that comes with that), leaving look control to other goals (e.g. HardLookAtTargetGoal), and attack control to other goals (e.g. AttackSpellBasicGoal).

Behavior:

  • If the target is too close (FLEE_DISTANCE): retreats
  • If the target is at optimal distance: stops movement
  • If the target is too far (SAFE_DISTANCE): advances towards it
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.world.entity.ai.goal.Goal

    net.minecraft.world.entity.ai.goal.Goal.Flag
  • Constructor Summary

    Constructors
    Constructor
    Description
    RangedKitingGoal(net.minecraft.world.entity.PathfinderMob mob, double moveSpeed)
    Simplified constructor with default distance values.
    RangedKitingGoal(net.minecraft.world.entity.PathfinderMob mob, double moveSpeed, double safeDistance, double fleeDistance, double followRange)
    General constructor, allowing full configuration for the kiting behavior.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    boolean
     
    boolean
     
    void
     
    void
     
    void
     

    Methods inherited from class net.minecraft.world.entity.ai.goal.Goal

    adjustedTickDelay, getFlags, isInterruptable, reducedTickDelay, setFlags, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RangedKitingGoal

      public RangedKitingGoal(net.minecraft.world.entity.PathfinderMob mob, double moveSpeed, double safeDistance, double fleeDistance, double followRange)
      General constructor, allowing full configuration for the kiting behavior.
      Parameters:
      mob - Mob that will use this goal
      moveSpeed - Movement speed when approaching or retreating
      safeDistance - Distance to maintain from the target
      fleeDistance - Minimum distance before retreating
      followRange - Maximum range to follow the target
    • RangedKitingGoal

      public RangedKitingGoal(net.minecraft.world.entity.PathfinderMob mob, double moveSpeed)
      Simplified constructor with default distance values.
      Parameters:
      mob - Mob that will use this goal
      moveSpeed - Movement speed when approaching or retreating
  • Method Details

    • canUse

      public boolean canUse()
      Specified by:
      canUse in class net.minecraft.world.entity.ai.goal.Goal
    • canContinueToUse

      public boolean canContinueToUse()
      Overrides:
      canContinueToUse in class net.minecraft.world.entity.ai.goal.Goal
    • requiresUpdateEveryTick

      public boolean requiresUpdateEveryTick()
      Overrides:
      requiresUpdateEveryTick in class net.minecraft.world.entity.ai.goal.Goal
    • start

      public void start()
      Overrides:
      start in class net.minecraft.world.entity.ai.goal.Goal
    • stop

      public void stop()
      Overrides:
      stop in class net.minecraft.world.entity.ai.goal.Goal
    • tick

      public void tick()
      Overrides:
      tick in class net.minecraft.world.entity.ai.goal.Goal