Package net.citizensnpcs.npc.ai
Class MCTargetStrategy
java.lang.Object
net.citizensnpcs.npc.ai.MCTargetStrategy
- All Implemented Interfaces:
EntityTarget,PathStrategy
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionMCTargetStrategy(NPC npc, Entity target, boolean aggro, NavigatorParameters params) -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the CancelReason returned byPathStrategy.getCancelReason()and attempts to resume pathfinding.getPath()booleanvoidstop()Forcibly stops pathfinding.toString()booleanupdate()Updates and runs the pathfinding strategy on its current NPC and destination.
-
Constructor Details
-
Method Details
-
clearCancelReason
public void clearCancelReason()Description copied from interface:PathStrategyClears the CancelReason returned byPathStrategy.getCancelReason()and attempts to resume pathfinding.- Specified by:
clearCancelReasonin interfacePathStrategy
-
getCancelReason
- Specified by:
getCancelReasonin interfacePathStrategy- Returns:
- The reason for the pathfinding to stop, or null if it is still continuing.
-
getCurrentDestination
- Specified by:
getCurrentDestinationin interfacePathStrategy- Returns:
- Gets the current movement destination
-
getPath
- Specified by:
getPathin interfacePathStrategy- Returns:
- A copy of the current path, if any
-
getTarget
- Specified by:
getTargetin interfaceEntityTarget- Returns:
- The
Entitybeing targeted.
-
getTargetAsLocation
- Specified by:
getTargetAsLocationin interfacePathStrategy- Returns:
- Gets the target destination location
-
getTargetType
- Specified by:
getTargetTypein interfacePathStrategy- Returns:
- The
TargetTypeof this strategy
-
isAggressive
public boolean isAggressive()- Specified by:
isAggressivein interfaceEntityTarget- Returns:
- Whether the entity target should be attacked once within range
-
stop
public void stop()Description copied from interface:PathStrategyForcibly stops pathfinding. Note that this method does not necessarily set the cancel reason.- Specified by:
stopin interfacePathStrategy
-
toString
-
update
public boolean update()Description copied from interface:PathStrategyUpdates and runs the pathfinding strategy on its current NPC and destination.- Specified by:
updatein interfacePathStrategy- Returns:
- Whether pathfinding has completed
-