Class Navigator
java.lang.Object
net.minestom.server.entity.pathfinding.Navigator
Necessary object for all
NavigableEntity
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull Entity
@NotNull PFPathingEntity
@Nullable Point
Gets the target pathfinder position.void
jump
(float height) moveTowards
(@NotNull Point direction, double speed) Used to move the entity towarddirection
in the X and Z axis Gravity is still applied but the entity will not attempt to jump Also update the yaw/pitch of the entity to look along 'direction'void
setPathFinder
(@Nullable com.extollit.gaming.ai.path.HydrazinePathFinder pathFinder) boolean
boolean
Retrieves the path toposition
and ask the entity to follow the path.void
tick()
-
Constructor Details
-
Navigator
-
-
Method Details
-
moveTowards
Used to move the entity towarddirection
in the X and Z axis Gravity is still applied but the entity will not attempt to jump Also update the yaw/pitch of the entity to look along 'direction'- Parameters:
direction
- the targeted positionspeed
- define how far the entity will move
-
jump
public void jump(float height) -
setPathTo
Retrieves the path toposition
and ask the entity to follow the path.Can be set to null to reset the pathfinder.
The position is cloned, if you want the entity to continually follow this position object you need to call this when you want the path to update.
- Parameters:
point
- the position to find the path to, null to reset the pathfinderbestEffort
- whether to use the best-effort algorithm to the destination, if false then this method is more likely to return immediately- Returns:
- true if a path has been found
-
setPathTo
- See Also:
-
tick
@Internal public void tick() -
getPathPosition
Gets the target pathfinder position.- Returns:
- the target pathfinder position, null if there is no one
-
getEntity
-
getPathingEntity
-
setPathFinder
@Internal public void setPathFinder(@Nullable @Nullable com.extollit.gaming.ai.path.HydrazinePathFinder pathFinder)
-