public interface Pathfinder
Modifier and Type | Interface | Description |
---|---|---|
static interface |
Pathfinder.PathResult |
Represents the result of a pathfinding calculation
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
canFloat() |
Checks if this pathfinder assumes that the mob can float
|
boolean |
canOpenDoors() |
Checks if this pathfinder allows passing through closed doors.
|
boolean |
canPassDoors() |
Checks if this pathfinder allows passing through open doors.
|
@Nullable Pathfinder.PathResult |
findPath(@NotNull LivingEntity target) |
Calculates a destination for the Entity to navigate to to reach the target entity,
but does not set it as the current target.
|
@Nullable Pathfinder.PathResult |
findPath(@NotNull Location loc) |
Calculates a destination for the Entity to navigate to, but does not set it
as the current target.
|
@Nullable Pathfinder.PathResult |
getCurrentPath() |
|
@NotNull Mob |
getEntity() |
|
boolean |
hasPath() |
If the entity is currently trying to navigate to a destination, this will return true
|
default boolean |
moveTo(@NotNull Pathfinder.PathResult path) |
Takes the result of a previous pathfinding calculation and sets it
as the active pathfinding with default speed.
|
boolean |
moveTo(@NotNull Pathfinder.PathResult path,
double speed) |
Takes the result of a previous pathfinding calculation and sets it
as the active pathfinding,
|
default boolean |
moveTo(@NotNull LivingEntity target) |
Calculates a destination for the Entity to navigate to to reach the target entity,
and sets it with default speed.
|
default boolean |
moveTo(@NotNull LivingEntity target,
double speed) |
Calculates a destination for the Entity to navigate to to reach the target entity,
and sets it with specified speed.
|
default boolean |
moveTo(@NotNull Location loc) |
Calculates a destination for the Entity to navigate to, and sets it with default speed
as the current target.
|
default boolean |
moveTo(@NotNull Location loc,
double speed) |
Calculates a destination for the Entity to navigate to, with desired speed
as the current target.
|
void |
setCanFloat(boolean canFloat) |
Makes this pathfinder assume that the mob can float, or not
|
void |
setCanOpenDoors(boolean canOpenDoors) |
Allows this pathfinder to pass through closed doors, or not
|
void |
setCanPassDoors(boolean canPassDoors) |
Allows this pathfinder to pass through open doors, or not
|
void |
stopPathfinding() |
Instructs the Entity to stop trying to navigate to its current desired location
|
@NotNull @NotNull Mob getEntity()
void stopPathfinding()
boolean hasPath()
@Nullable @Nullable Pathfinder.PathResult getCurrentPath()
@Nullable @Nullable Pathfinder.PathResult findPath(@NotNull @NotNull Location loc)
loc
- Location to navigate to@Nullable @Nullable Pathfinder.PathResult findPath(@NotNull @NotNull LivingEntity target)
target
- the Entity to navigate todefault boolean moveTo(@NotNull @NotNull Location loc)
loc
- Location to navigate todefault boolean moveTo(@NotNull @NotNull Location loc, double speed)
loc
- Location to navigate tospeed
- Speed multiplier to navigate at, where 1 is 'normal'default boolean moveTo(@NotNull @NotNull LivingEntity target)
target
- the Entity to navigate todefault boolean moveTo(@NotNull @NotNull LivingEntity target, double speed)
target
- the Entity to navigate tospeed
- Speed multiplier to navigate at, where 1 is 'normal'default boolean moveTo(@NotNull @NotNull Pathfinder.PathResult path)
path
- The Path to start followingboolean moveTo(@NotNull @NotNull Pathfinder.PathResult path, double speed)
path
- The Path to start followingspeed
- Speed multiplier to navigate at, where 1 is 'normal'boolean canOpenDoors()
void setCanOpenDoors(boolean canOpenDoors)
canOpenDoors
- if the mob can pass through closed doors, or notboolean canPassDoors()
void setCanPassDoors(boolean canPassDoors)
canPassDoors
- if the mob can pass through open doors, or notboolean canFloat()
void setCanFloat(boolean canFloat)
canFloat
- if the mob can float, or notCopyright © 2020. All rights reserved.