Package net.citizensnpcs.npc.ai
Class CitizensNavigator
java.lang.Object
net.citizensnpcs.npc.ai.CitizensNavigator
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidCancels any running navigation towards a target.voidcancelNavigation(CancelReason reason) Cancels any running navigation towards a target with a specificCancelReason.booleancanNavigateTo(Location dest) booleancanNavigateTo(Location dest, NavigatorParameters params) Returns whether the NPC can navigate to the given destination with the navigator parameters.Returns theNavigatorParameterslocal to this navigator.Returns the currentEntityTargetof the navigator, if any.Returns theNavigatorParameterslocal to any current target execution.getNPC()booleanbooleanisPaused()voidvoidvoidonSpawn()voidrun()voidvoidsetPaused(boolean paused) Sets whether the navigator is paused and shouldn't process the path for now.voidsetStraightLineTarget(Entity target, boolean aggressive) Sets the current navigation to an entity target.voidsetStraightLineTarget(Location target) Sets the current navigation to aLocationdestination.voidSets the current navigation using a list ofVectors which will be moved between sequentially using the Citizens movement logic without pathfinding.voidsetTarget(Function<NavigatorParameters, PathStrategy> strategy) Sets the current navigation to the specified strategy.voidSets the current navigation to an entity target.voidSets the current navigation to aLocationdestination.
- 
Constructor Details- 
CitizensNavigator
 
- 
- 
Method Details
- 
getDefaultParametersDescription copied from interface:NavigatorReturns theNavigatorParameterslocal to this navigator. These parameters are copied to local target parameters when a new target is started.- Specified by:
- getDefaultParametersin interface- Navigator
- Returns:
- The default parameters
- See Also:
 
- 
getEntityTargetDescription copied from interface:NavigatorReturns the currentEntityTargetof the navigator, if any. May return null.- Specified by:
- getEntityTargetin interface- Navigator
- Returns:
- The current entity target
 
- 
getLocalParametersDescription copied from interface:NavigatorReturns theNavigatorParameterslocal to any current target execution. These are updated independently of the default parameters.- Specified by:
- getLocalParametersin interface- Navigator
- Returns:
- The local parameters
- See Also:
 
- 
getNPC
- 
getPathStrategy- Specified by:
- getPathStrategyin interface- Navigator
- Returns:
- The current PathStrategyor null if the navigator is not pathfinding
 
- 
getTargetAsLocationDescription copied from interface:NavigatorReturns the currentLocationbeing navigated towards - this is not necessarily permanent and may change, for example when pathing towards a movingEntity. May return null.- Specified by:
- getTargetAsLocationin interface- Navigator
- Returns:
- The target location
 
- 
getTargetType- Specified by:
- getTargetTypein interface- Navigator
- Returns:
- The current TargetTypeof the navigator
 
- 
isPausedpublic boolean isPaused()
- 
load
- 
onDespawnpublic void onDespawn()
- 
onSpawnpublic void onSpawn()
- 
runpublic void run()
- 
save
- 
setPausedpublic void setPaused(boolean paused) Description copied from interface:NavigatorSets whether the navigator is paused and shouldn't process the path for now.
- 
setStraightLineTargetDescription copied from interface:NavigatorSets the current navigation to an entity target. The NPC will walk towards them in a straight line without pathfinding.- Specified by:
- setStraightLineTargetin interface- Navigator
- Parameters:
- target- The- Entityto walk towards
- aggressive- Whether to attack the target when close enough
 
- 
setStraightLineTargetDescription copied from interface:NavigatorSets the current navigation to aLocationdestination. The NPC will walk straight towards it without pathfinding.- Specified by:
- setStraightLineTargetin interface- Navigator
- Parameters:
- target- The destination
 
- 
setTargetDescription copied from interface:NavigatorSets the current navigation to an entity target.
- 
setTargetDescription copied from interface:NavigatorSets the current navigation to the specified strategy.
- 
setTargetDescription copied from interface:NavigatorSets the current navigation using a list ofVectors which will be moved between sequentially using the Citizens movement logic without pathfinding.
- 
setTargetDescription copied from interface:NavigatorSets the current navigation to aLocationdestination.