Interface FindNearestAttackableTargetGoal
-
- All Superinterfaces:
Goal<Creature>
,TargetGoal<FindNearestAttackableTargetGoal>
public interface FindNearestAttackableTargetGoal extends TargetGoal<FindNearestAttackableTargetGoal>
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
FindNearestAttackableTargetGoal.Builder
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static FindNearestAttackableTargetGoal.Builder
builder()
Creates a newFindNearestAttackableTargetGoal.Builder
for building a newFindNearestAttackableTargetGoal
.int
chance()
Gets the chance that this task will go through and attempt to find a new target.Predicate<Living>
filter()
Gets thePredicate
filter to determine whether aliving entity
can be targeted.FindNearestAttackableTargetGoal
filter(Predicate<Living> predicate)
FindNearestAttackableTargetGoal
setChance(int chance)
Sets the chance that this task will go through and attempt to find a new target.FindNearestAttackableTargetGoal
setTargetClass(Class<? extends Living> targetClass)
Sets theentity class
that can be targeted.Class<? extends Living>
targetClass()
Gets theentity class
that can be targeted.-
Methods inherited from interface org.spongepowered.api.entity.ai.goal.Goal
canBeInterrupted, canRunConcurrentWith, executor, owner, type
-
Methods inherited from interface org.spongepowered.api.entity.ai.goal.builtin.creature.target.TargetGoal
setCheckOnlyNearby, setCheckSight, shouldCheckOnlyNearby, shouldCheckSight
-
-
-
-
Method Detail
-
builder
static FindNearestAttackableTargetGoal.Builder builder()
Creates a newFindNearestAttackableTargetGoal.Builder
for building a newFindNearestAttackableTargetGoal
.- Returns:
- A new builder
-
targetClass
Class<? extends Living> targetClass()
Gets theentity class
that can be targeted.- Returns:
- The entity class that can be targeted
-
setTargetClass
FindNearestAttackableTargetGoal setTargetClass(Class<? extends Living> targetClass)
Sets theentity class
that can be targeted.- Parameters:
targetClass
- The entity class to target- Returns:
- This task, for chaining
-
chance
int chance()
Gets the chance that this task will go through and attempt to find a new target.- Returns:
- The chance that this task will go through and find a target
-
setChance
FindNearestAttackableTargetGoal setChance(int chance)
Sets the chance that this task will go through and attempt to find a new target.- Parameters:
chance
- The chance that this task will attemp to find a new target- Returns:
- This task, for chaining
-
filter
FindNearestAttackableTargetGoal filter(Predicate<Living> predicate)
- Parameters:
predicate
- The predicate- Returns:
- This task, for chaining
-
filter
Predicate<Living> filter()
Gets thePredicate
filter to determine whether aliving entity
can be targeted.- Returns:
- The predicate to filter living entities for targeting
-
-