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