Class PathfinderRangedAttack
java.lang.Object
me.gamercoder215.mobchip.ai.goal.Pathfinder
me.gamercoder215.mobchip.ai.goal.PathfinderRangedAttack
- All Implemented Interfaces:
PathfinderInfo, Ranged, SpeedModifier
Represents a Pathfinder for a ranged entity to shoot ranged projectiles
-
Nested Class Summary
Nested classes/interfaces inherited from class Pathfinder
Pathfinder.PathfinderFlag -
Field Summary
Fields inherited from class Pathfinder
entityFields inherited from interface Ranged
DEFAULT_ATTACK_INTERVAL, DEFAULT_ATTACK_RANGE, DEFAULT_LOOK_RANGEFields inherited from interface SpeedModifier
DEFAULT_SPEED_MODIFIER -
Constructor Summary
ConstructorsConstructorDescriptionPathfinderRangedAttack(@NotNull ProjectileSource m, double speedMod) Constructs a PathfinderRangedAttack with the default attack range.PathfinderRangedAttack(@NotNull ProjectileSource m, double speedMod, float range) Constructs a PathfinderRangedAttack with the default interval.PathfinderRangedAttack(@NotNull ProjectileSource m, double speedMod, float range, int interval) Constructs a PathfinderRangedAttack with the max and min intervals the same.PathfinderRangedAttack(@NotNull ProjectileSource m, double speedMod, float range, int attackMin, int attackMax) Constructs a PathfinderRangedAttack. -
Method Summary
Modifier and TypeMethodDescription@NotNull Pathfinder.PathfinderFlag[]getFlags()Fetches an Array of Flags that this Pathfinder has.Returns the pathfinder's internal name.intFetches the maximum attack interval, in ticks.intFetches the minimum attack interval, in ticks.floatgetRange()Gets the current Range.doubleGet the Speed Modifier of this Pathfinder.voidsetMaxAttackInterval(int max) Sets the maximum attack interval, in ticks.voidsetMinAttackInterval(int min) Sets the minimum attack interval, in ticks.voidsetRange(float range) Sets the current Range.voidsetSpeedModifier(double mod) Sets the Speed Modifier of this Pathfinder.Methods 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
-
PathfinderRangedAttack
Constructs a PathfinderRangedAttack with the default attack range.- Parameters:
m- ProjectileSource to usespeedMod- Speed Modifier while attacking
-
PathfinderRangedAttack
Constructs a PathfinderRangedAttack with the default interval.- Parameters:
m- Skeleton to usespeedMod- Speed Modifier while attackingrange- Range of attack
-
PathfinderRangedAttack
public PathfinderRangedAttack(@NotNull @NotNull ProjectileSource m, double speedMod, float range, int interval) Constructs a PathfinderRangedAttack with the max and min intervals the same.- Parameters:
m- ProjectileSource to usespeedMod- Speed Modifier while attackingrange- Range of attackinterval- Interval of attack, in ticks
-
PathfinderRangedAttack
public PathfinderRangedAttack(@NotNull @NotNull ProjectileSource m, double speedMod, float range, int attackMin, int attackMax) Constructs a PathfinderRangedAttack.- Parameters:
m- Skeleton to usespeedMod- Speed Modifier while attackingrange- Range of attackattackMin- Minimum Interval of attack, in ticksattackMax- Maximum Interval of attack, in ticks
-
-
Method Details
-
getMinAttackInterval
public int getMinAttackInterval()Fetches the minimum attack interval, in ticks.- Returns:
- Minimum Attack Interval
-
getMaxAttackInterval
public int getMaxAttackInterval()Fetches the maximum attack interval, in ticks.- Returns:
- Maximum Attack Interval
-
setMinAttackInterval
public void setMinAttackInterval(int min) Sets the minimum attack interval, in ticks.- Parameters:
min- minimum attack interval
-
setMaxAttackInterval
public void setMaxAttackInterval(int max) Sets the maximum attack interval, in ticks.- Parameters:
max- maximum attack interval
-
getRange
-
setRange
-
getSpeedModifier
public double getSpeedModifier()Description copied from interface:SpeedModifierGet the Speed Modifier of this Pathfinder.- Specified by:
getSpeedModifierin interfaceSpeedModifier- Returns:
- Speed Modifier
-
setSpeedModifier
public void setSpeedModifier(double mod) Description copied from interface:SpeedModifierSets the Speed Modifier of this Pathfinder.- Specified by:
setSpeedModifierin interfaceSpeedModifier- Parameters:
mod- Modifier 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
-