Interface AvoidLivingGoal

All Superinterfaces:
Goal<PathfinderAgent>

public interface AvoidLivingGoal extends Goal<PathfinderAgent>
  • Method Details

    • builder

      static AvoidLivingGoal.Builder builder()
      Creates a new AvoidLivingGoal.Builder for creating a new AvoidLivingGoal.
      Returns:
      A new builder
    • targetSelector

      Predicate<Living> targetSelector()
      Gets the Predicate for filtering which Living instances are qualified to have the owning Agent move away from the Living of which the Predicate.test(Object) returns true.
      Returns:
      The predicate used to filter which entities to avoid
    • setTargetSelector

      AvoidLivingGoal setTargetSelector(Predicate<Living> predicate)
      Sets the Predicate for filtering which Living instances are considered to be "avoided" by the owning Agent.
      Parameters:
      predicate - The predicate
      Returns:
      This task, for chaining
    • searchDistance

      float searchDistance()
      Gets the search distance at which any Living instances in a radius of the parent Agent are considered for avoiding.
      Returns:
      The search distance
    • setSearchDistance

      AvoidLivingGoal setSearchDistance(float distance)
      Sets the search distance at which any Living instances in a radius of the parent Agent are considered for avoiding.
      Parameters:
      distance - The search distance
      Returns:
      This task, for chaining
    • closeRangeSpeed

      double closeRangeSpeed()
      Gets the speed "modifier" for which the parent Agent will move away from a found Living to "avoid" when in close range. Close range is currently defined as 7 blocks.
      Returns:
      The close range movement speed modifier
    • setCloseRangeSpeed

      AvoidLivingGoal setCloseRangeSpeed(double speed)
      Sets the peed "modifier" for which the parent Agent will move away from a found Living to "avoid" when in close range. Close range is currently defined as 7 blocks.
      Parameters:
      speed - The movement speed modifier
      Returns:
      This task, for chaining
    • farRangeSpeed

      double farRangeSpeed()
      Gets the close range speed "modifier" for which the parent Agent will move away from a found Living to "avoid" when in a farther range than 7 blocks.
      Returns:
      The close range speed
    • setFarRangeSpeed

      AvoidLivingGoal setFarRangeSpeed(double speed)
      Sets the close range speed "modifier" for which the parent Agent will move away from a found Living to "avoid" when in a farther range than 7 blocks.
      Parameters:
      speed - The movement speed modifier
      Returns:
      This task, for chaining