Class PathfinderAvoidEntity<T extends LivingEntity>

java.lang.Object
me.gamercoder215.mobchip.ai.goal.Pathfinder
me.gamercoder215.mobchip.ai.goal.PathfinderAvoidEntity<T>
Type Parameters:
T - Class of Entities to avoid
All Implemented Interfaces:
PathfinderInfo, Filtering<T>, SpeedModifier

public final class PathfinderAvoidEntity<T extends LivingEntity> extends Pathfinder implements Filtering<T>, SpeedModifier
Represents a Pathfinder to avoid a LivingEntity
  • Constructor Details

  • Method Details

    • getMaxDistance

      public float getMaxDistance()
      Get the maximum distance needed to stop avoiding the target, in blocks (meters).
      Returns:
      Max distance to stop avoiding
    • setMaxDistance

      public void setMaxDistance(float dist)
      Sets the maximum distance needed to stop avoiding the target, in blocks (meters).
      Parameters:
      dist - New distance to set
    • getSpeedModifier

      public double getSpeedModifier()
      Description copied from interface: SpeedModifier
      Get the Speed Modifier of this Pathfinder.
      Specified by:
      getSpeedModifier in interface SpeedModifier
      Returns:
      Speed Modifier
    • getSprintModifier

      public double getSprintModifier()
      Gets the current sprint modifier.
      Returns:
      Sprint Modifier
    • setSprintModifier

      public void setSprintModifier(double mod)
      Sets the current Sprint Modifier.
      Parameters:
      mod - Sprint Modifier
    • getAvoidPredicate

      @Nullable public @Nullable Predicate<T> getAvoidPredicate()
      Gets the current avoid predicate.
      Returns:
      Avoid Predicate used to determine the entity to avoid
    • setAvoidPredicate

      public void setAvoidPredicate(@Nullable @Nullable Predicate<T> avoidPredicate)
      Sets the current avoid predicate.
      Parameters:
      avoidPredicate - Avoiding Predicate used to determine the entity to avoid
    • getAvoidingPredicate

      @Nullable public @Nullable Predicate<T> getAvoidingPredicate()
      Gets the current avoiding predicate.
      Returns:
      Avoiding Predicate used to determine if the entity should continue avoiding
    • setAvoidingPredicate

      public void setAvoidingPredicate(@Nullable @Nullable Predicate<T> avoidingPredicate)
      Sets the current avoiding predicate.
      Parameters:
      avoidingPredicate - Avoiding Predicate used to determine if the entity should continue avoiding
    • setSpeedModifier

      public void setSpeedModifier(double mod)
      Description copied from interface: SpeedModifier
      Sets the Speed Modifier of this Pathfinder.
      Specified by:
      setSpeedModifier in interface SpeedModifier
      Parameters:
      mod - Modifier to set
    • setFilter

      public void setFilter(@NotNull @NotNull Class<T> clazz)
      Description copied from interface: Filtering
      Set the Filter that this Pathfinder is looking for.
      Specified by:
      setFilter in interface Filtering<T extends LivingEntity>
      Parameters:
      clazz - Filter to set
    • getFilter

      @NotNull public @NotNull Class<T> getFilter()
      Description copied from interface: Filtering
      Get the filter that this Pathfinder is looking for.
      Specified by:
      getFilter in interface Filtering<T extends LivingEntity>
      Returns:
      Filter found
    • getEntity

      @NotNull public @NotNull Creature getEntity()
      Description copied from class: Pathfinder
      Get the entity involved in this Pathfinder.
      Overrides:
      getEntity in class Pathfinder
      Returns:
      Creature involved
    • getFlags

      Description copied from class: Pathfinder

      Fetches an Array of Flags that this Pathfinder has.

      Specified by:
      getFlags in class Pathfinder
      Returns:
      Array of Pathfinder Flags
    • getInternalName

      public String getInternalName()
      Description copied from interface: PathfinderInfo
      Returns the NMS Internal Name.
      Specified by:
      getInternalName in interface PathfinderInfo
      Returns:
      Internal Name