Class PathfinderNearestAttackableTarget<T extends LivingEntity>
java.lang.Object
me.gamercoder215.mobchip.ai.goal.Pathfinder
me.gamercoder215.mobchip.ai.goal.target.TargetPathfinder
me.gamercoder215.mobchip.ai.goal.target.PathfinderNearestAttackableTarget<T>
- Type Parameters:
T- Type of Target to look for
- All Implemented Interfaces:
Conditional<LivingEntity>, PathfinderInfo, Repeated, Filtering<T>, Targeting
- Direct Known Subclasses:
PathfinderNearestAttackableTargetRaider, PathfinderNearestHealableRaider, PathfinderWildTarget
public class PathfinderNearestAttackableTarget<T extends LivingEntity>
extends TargetPathfinder
implements Filtering<T>, Conditional<LivingEntity>, Repeated
Represents a Pathfinder to target a specific type of Entity
-
Nested Class Summary
Nested classes/interfaces inherited from class Pathfinder
Pathfinder.PathfinderFlag -
Field Summary
Fields inherited from class Pathfinder
entity -
Constructor Summary
ConstructorsConstructorDescriptionPathfinderNearestAttackableTarget(@NotNull Mob m, @NotNull Class<T> filter) Constructs a PathfinderNearestAttackableTarget with a default interval of 10.PathfinderNearestAttackableTarget(@NotNull Mob m, @NotNull Class<T> filter, int interval) Constructs a PathfinderNearestAttackableTarget with see and reach set to true.PathfinderNearestAttackableTarget(@NotNull Mob m, @NotNull Class<T> filter, int interval, boolean mustSee, boolean reach) Constructs a PathfinderNearestAttackableTarget with no conditions.PathfinderNearestAttackableTarget(@NotNull Mob m, @NotNull Class<T> filter, int interval, boolean mustSee, boolean reach, @Nullable Predicate<LivingEntity> conditions) Constructs a PathfinderNearestAttackableTarget. -
Method Summary
Modifier and TypeMethodDescription@NotNull Predicate<LivingEntity> Sets the Condition of this Conditional Pathfinder.Get the filter that this Pathfinder is looking for.@NotNull Pathfinder.PathfinderFlag[]getFlags()Fetches an Array of Flags that this Pathfinder has.Returns the pathfinder's internal name.intGets the current attack interval, in ticks.voidsetCondition(@NotNull Predicate<LivingEntity> condition) Sets the Condition of this Conditional Pathfinder.voidSet the Filter that this Pathfinder is looking for.voidsetInterval(int interval) Sets the current attack interval, in ticks.Methods inherited from class TargetPathfinder
mustReach, mustSee, setReach, setSeeMethods inherited from class Pathfinder
getEntityMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PathfinderInfo
getName
-
Constructor Details
-
PathfinderNearestAttackableTarget
public PathfinderNearestAttackableTarget(@NotNull @NotNull Mob m, @NotNull @NotNull Class<T> filter) throws IllegalArgumentException Constructs a PathfinderNearestAttackableTarget with a default interval of 10.- Parameters:
m- Mob to usefilter- Class of entity to find- Throws:
IllegalArgumentException- if class is null
-
PathfinderNearestAttackableTarget
public PathfinderNearestAttackableTarget(@NotNull @NotNull Mob m, @NotNull @NotNull Class<T> filter, int interval) throws IllegalArgumentException Constructs a PathfinderNearestAttackableTarget with see and reach set to true.- Parameters:
m- Mob to usefilter- Class of entity to findinterval- Interval of attack, in ticks- Throws:
IllegalArgumentException- if class is null
-
PathfinderNearestAttackableTarget
public PathfinderNearestAttackableTarget(@NotNull @NotNull Mob m, @NotNull @NotNull Class<T> filter, int interval, boolean mustSee, boolean reach) throws IllegalArgumentException Constructs a PathfinderNearestAttackableTarget with no conditions.- Parameters:
m- Mob to usefilter- Class of entity to findinterval- Interval of attack, in ticksmustSee- Whether entity must see targetreach- Whether entity must reach target- Throws:
IllegalArgumentException- if class is null
-
PathfinderNearestAttackableTarget
public PathfinderNearestAttackableTarget(@NotNull @NotNull Mob m, @NotNull @NotNull Class<T> filter, int interval, boolean mustSee, boolean reach, @Nullable @Nullable Predicate<LivingEntity> conditions) throws IllegalArgumentException Constructs a PathfinderNearestAttackableTarget.- Parameters:
m- Mob to usefilter- Class of entity to findinterval- Interval of attack, in ticksmustSee- Whether entity must see targetreach- Whether entity must reach targetconditions- Conditions needed to attack- Throws:
IllegalArgumentException- if filter is null
-
-
Method Details
-
setFilter
Description copied from interface:FilteringSet the Filter that this Pathfinder is looking for.- Specified by:
setFilterin interfaceFiltering<T extends LivingEntity>- Parameters:
clazz- Filter to set- Throws:
IllegalArgumentException- if clazz is null
-
getFilter
-
getInterval
public int getInterval()Gets the current attack interval, in ticks.- Specified by:
getIntervalin interfaceRepeated- Returns:
- Attack Interval
-
setInterval
Sets the current attack interval, in ticks.- Specified by:
setIntervalin interfaceRepeated- Parameters:
interval- Attack interval to set- Throws:
IllegalArgumentException- if less than 0
-
getCondition
Description copied from interface:ConditionalSets the Condition of this Conditional Pathfinder.- Specified by:
getConditionin interfaceConditional<T extends LivingEntity>- Returns:
- Predicate of Condition
-
setCondition
Description copied from interface:ConditionalSets the Condition of this Conditional Pathfinder.- Specified by:
setConditionin interfaceConditional<T extends LivingEntity>- Parameters:
condition- Condition to set
-
getFlags
Description copied from class:PathfinderFetches an Array of Flags that this Pathfinder has.
- Specified by:
getFlagsin classPathfinder- Returns:
- Array of Pathfinder Flags
-
getInternalName
Description copied from interface:PathfinderInfoReturns the pathfinder's internal name. This may match the actual NMS name of the pathfinder, but it may not.- Specified by:
getInternalNamein interfacePathfinderInfo- Returns:
- Internal Name
-