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 me.gamercoder215.mobchip.ai.goal.Pathfinder
Pathfinder.PathfinderFlag
-
Field Summary
Fields inherited from class me.gamercoder215.mobchip.ai.goal.Pathfinder
entity
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a PathfinderNearestAttackableTarget with a default interval of 10.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 TypeMethodDescriptionSets the Condition of this Conditional Pathfinder.Get the filter that this Pathfinder is looking for.getFlags()
Fetches an Array of Flags that this Pathfinder has.Returns the NMS Internal Name.int
Gets the current attack interval, in ticks.void
setCondition
(@NotNull Predicate<LivingEntity> condition) Sets the Condition of this Conditional Pathfinder.void
Set the Filter that this Pathfinder is looking for.void
setInterval
(int interval) Sets the current attack interval, in ticks.Methods inherited from class me.gamercoder215.mobchip.ai.goal.target.TargetPathfinder
mustReach, mustSee, setReach, setSee
Methods inherited from class me.gamercoder215.mobchip.ai.goal.Pathfinder
getEntity
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface me.gamercoder215.mobchip.ai.goal.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:Filtering
Set the Filter that this Pathfinder is looking for.- Specified by:
setFilter
in interfaceFiltering<T extends LivingEntity>
- Parameters:
clazz
- Filter to set- Throws:
IllegalArgumentException
- if clazz is null
-
getFilter
Description copied from interface:Filtering
Get the filter that this Pathfinder is looking for.- Specified by:
getFilter
in interfaceFiltering<T extends LivingEntity>
- Returns:
- Filter found
-
getInterval
public int getInterval()Gets the current attack interval, in ticks.- Specified by:
getInterval
in interfaceRepeated
- Returns:
- Attack Interval
-
setInterval
Sets the current attack interval, in ticks.- Specified by:
setInterval
in interfaceRepeated
- Parameters:
interval
- Attack interval to set- Throws:
IllegalArgumentException
- if less than 0
-
getCondition
Description copied from interface:Conditional
Sets the Condition of this Conditional Pathfinder.- Specified by:
getCondition
in interfaceConditional<T extends LivingEntity>
- Returns:
- Predicate of Condition
-
setCondition
Description copied from interface:Conditional
Sets the Condition of this Conditional Pathfinder.- Specified by:
setCondition
in interfaceConditional<T extends LivingEntity>
- Parameters:
condition
- Condition to set
-
getFlags
Description copied from class:Pathfinder
Fetches an Array of Flags that this Pathfinder has.
- Specified by:
getFlags
in classPathfinder
- Returns:
- Array of Pathfinder Flags
-
getInternalName
Description copied from interface:PathfinderInfo
Returns the NMS Internal Name.- Specified by:
getInternalName
in interfacePathfinderInfo
- Returns:
- Internal Name
-