Class PathfinderMeleeAttack
java.lang.Object
me.gamercoder215.mobchip.ai.goal.Pathfinder
me.gamercoder215.mobchip.ai.goal.PathfinderMeleeAttack
- All Implemented Interfaces:
PathfinderInfo, Targeting, SpeedModifier
- Direct Known Subclasses:
PathfinderZombieAttack
Represents a Pathfinder for a Creature to attack.
This Pathfinder does not look for entities to attack, but only attacks them. To look for entities, use
Any entities that do not normally attack (i.e. animals) most commonly do not have attack attributes.
An entity that attacks without an Attack Attribute will crash the server.
This Pathfinder does not look for entities to attack, but only attacks them. To look for entities, use
PathfinderNearestAttackableTarget and its subclasses.
Any entities that do not normally attack (i.e. animals) most commonly do not have attack attributes.
An entity that attacks without an Attack Attribute will crash the server.
-
Nested Class Summary
Nested classes/interfaces inherited from class Pathfinder
Pathfinder.PathfinderFlag -
Field Summary
Fields inherited from class Pathfinder
entityFields inherited from interface SpeedModifier
DEFAULT_SPEED_MODIFIER -
Constructor Summary
ConstructorsConstructorDescriptionPathfinderMeleeAttack(@NotNull Creature c) Constructs a PathfinderMeleeAttack with the default Speed Modifier.PathfinderMeleeAttack(@NotNull Creature c, double speedMod) Constructs a PathfinderMeleeAttack with must see set to true.PathfinderMeleeAttack(@NotNull Creature c, double speedMod, boolean see) Constructs a PathfinderMeleeAttack. -
Method Summary
Modifier and TypeMethodDescription@NotNull Pathfinder.PathfinderFlag[]getFlags()Fetches an Array of Flags that this Pathfinder has.Returns the pathfinder's internal name.doubleGet the Speed Modifier of this Pathfinder.booleanmustSee()Whether the entity must see the target.voidsetSee(boolean see) Sets whether the entity must see the target.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
-
PathfinderMeleeAttack
Constructs a PathfinderMeleeAttack with the default Speed Modifier.- Parameters:
c- Creature to use
-
PathfinderMeleeAttack
Constructs a PathfinderMeleeAttack with must see set to true.- Parameters:
c- Creature to usespeedMod- Speed Modifier while attacking
-
PathfinderMeleeAttack
public PathfinderMeleeAttack(@NotNull @NotNull Creature c, double speedMod, boolean see) throws IllegalArgumentException Constructs a PathfinderMeleeAttack.- Parameters:
c- Creature to usespeedMod- Speed Modifier while attackingsee- Whether the Creature must see the target in order to attack- Throws:
IllegalArgumentException- if interval is less than 0
-
-
Method Details
-
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
-
mustSee
-
setSee
-
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
-