Class Navigator
java.lang.Object
net.minestom.server.entity.pathfinding.Navigator
Necessary object for all
NavigableEntity.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the entity which is navigating.Gets the target pathfinder position.getNodes()getState()booleanvoidreset()voidsetNodeFollower(Supplier<NodeFollower> nodeFollower) voidsetNodeGenerator(Supplier<NodeGenerator> nodeGenerator) booleanbooleansetPathTo(@Nullable Point point, double minimumDistance, double maxDistance, double pathVariance, @Nullable Runnable onComplete) Sets the path topositionand ask the entity to follow the path.booleanvoidtick()
-
Constructor Details
-
Navigator
-
-
Method Details
-
getState
-
setPathTo
-
setPathTo
-
setPathTo
public boolean setPathTo(@Nullable @Nullable Point point, double minimumDistance, double maxDistance, double pathVariance, @Nullable @Nullable Runnable onComplete) Sets the path topositionand ask the entity to follow the path.- Parameters:
point- the position to find the path to, null to reset the pathfinderminimumDistance- distance to target when completedmaxDistance- maximum search distancepathVariance- how far to search off of the direct path. For open worlds, this can be low (around 20) and for large mazes this needs to be very high.onComplete- called when the path has been completed- Returns:
- true if a path is being generated
-
tick
-
getGoalPosition
-
getEntity
-
reset
public void reset() -
isComplete
public boolean isComplete() -
getNodes
-
getPathPosition
-
setNodeFollower
-
setNodeGenerator
-