Interface AvoidLivingGoal
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceAvoidLivingGoal.Builder
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static AvoidLivingGoal.Builderbuilder()Creates a newAvoidLivingGoal.Builderfor creating a newAvoidLivingGoal.doublecloseRangeSpeed()doublefarRangeSpeed()floatsearchDistance()AvoidLivingGoalsetCloseRangeSpeed(double speed)AvoidLivingGoalsetFarRangeSpeed(double speed)AvoidLivingGoalsetSearchDistance(float distance)AvoidLivingGoalsetTargetSelector(java.util.function.Predicate<Living> predicate)java.util.function.Predicate<Living>targetSelector()-
Methods inherited from interface org.spongepowered.api.entity.ai.goal.Goal
canBeInterrupted, canRunConcurrentWith, executor, owner, type
-
-
-
-
Method Detail
-
builder
static AvoidLivingGoal.Builder builder()
Creates a newAvoidLivingGoal.Builderfor creating a newAvoidLivingGoal.- Returns:
- A new builder
-
targetSelector
java.util.function.Predicate<Living> targetSelector()
Gets thePredicatefor filtering whichLivinginstances are qualified to have the owningAgentmove away from theLivingof which thePredicate.test(Object)returnstrue.- Returns:
- The predicate used to filter which entities to avoid
-
setTargetSelector
AvoidLivingGoal setTargetSelector(java.util.function.Predicate<Living> predicate)
Sets thePredicatefor filtering whichLivinginstances are considered to be "avoided" by the owningAgent.- Parameters:
predicate- The predicate- Returns:
- This task, for chaining
-
searchDistance
float searchDistance()
Gets the search distance at which anyLivinginstances in a radius of the parentAgentare considered for avoiding.- Returns:
- The search distance
-
setSearchDistance
AvoidLivingGoal setSearchDistance(float distance)
Sets the search distance at which anyLivinginstances in a radius of the parentAgentare considered for avoiding.- Parameters:
distance- The search distance- Returns:
- This task, for chaining
-
closeRangeSpeed
double closeRangeSpeed()
Gets the speed "modifier" for which the parentAgentwill move away from a foundLivingto "avoid" when in close range. Close range is currently defined as7blocks.- Returns:
- The close range movement speed modifier
-
setCloseRangeSpeed
AvoidLivingGoal setCloseRangeSpeed(double speed)
Sets the peed "modifier" for which the parentAgentwill move away from a foundLivingto "avoid" when in close range. Close range is currently defined as7blocks.- Parameters:
speed- The movement speed modifier- Returns:
- This task, for chaining
-
farRangeSpeed
double farRangeSpeed()
Gets the close range speed "modifier" for which the parentAgentwill move away from a foundLivingto "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 parentAgentwill move away from a foundLivingto "avoid" when in a farther range than 7 blocks.- Parameters:
speed- The movement speed modifier- Returns:
- This task, for chaining
-
-