Class EntityNavigation

java.lang.Object
net.minecraft.entity.ai.pathing.EntityNavigation
Direct Known Subclasses:
BirdNavigation, MobNavigation, SwimNavigation

public abstract class EntityNavigation
extends Object
  • Field Details

    • entity

      protected final MobEntity entity
    • world

      protected final World world
    • currentPath

      @Nullable protected Path currentPath
    • speed

      protected double speed
    • tickCount

      protected int tickCount
    • pathStartTime

      protected int pathStartTime
    • pathStartPos

      protected Vec3d pathStartPos
    • lastNodePosition

      protected Vec3i lastNodePosition
    • currentNodeMs

      protected long currentNodeMs
    • lastActiveTickMs

      protected long lastActiveTickMs
    • currentNodeTimeout

      protected double currentNodeTimeout
    • nodeReachProximity

      protected float nodeReachProximity
      If the Chebyshev distance from the entity to the next node is less than or equal to this value, the entity is considered "reached" the node.
    • shouldRecalculate

      protected boolean shouldRecalculate
    • lastRecalculateTime

      protected long lastRecalculateTime
    • nodeMaker

      protected PathNodeMaker nodeMaker
    • currentTarget

      private BlockPos currentTarget
    • currentDistance

      private int currentDistance
    • rangeMultiplier

      private float rangeMultiplier
    • pathNodeNavigator

      private final PathNodeNavigator pathNodeNavigator
    • nearPathStartPos

      private boolean nearPathStartPos
  • Constructor Details

    • EntityNavigation

      public EntityNavigation​(MobEntity mob, World world)
  • Method Details

    • resetRangeMultiplier

      public void resetRangeMultiplier()
    • setRangeMultiplier

      public void setRangeMultiplier​(float rangeMultiplier)
    • getTargetPos

      public BlockPos getTargetPos()
    • createPathNodeNavigator

      protected abstract PathNodeNavigator createPathNodeNavigator​(int range)
    • setSpeed

      public void setSpeed​(double speed)
    • shouldRecalculatePath

      public boolean shouldRecalculatePath()
    • recalculatePath

      public void recalculatePath()
    • findPathTo

      @Nullable public final Path findPathTo​(double x, double y, double z, int distance)
    • findPathToAny

      @Nullable public Path findPathToAny​(Stream<BlockPos> positions, int distance)
    • method_29934

      @Nullable public Path method_29934​(Set<BlockPos> set, int int2)
    • findPathTo

      @Nullable public Path findPathTo​(BlockPos target, int distance)
    • findPathTo

      @Nullable public Path findPathTo​(Entity entity, int distance)
    • findPathToAny

      @Nullable protected Path findPathToAny​(Set<BlockPos> positions, int range, boolean bool, int distance)
    • startMovingTo

      public boolean startMovingTo​(double x, double y, double z, double speed)
    • startMovingTo

      public boolean startMovingTo​(Entity entity, double speed)
    • startMovingAlong

      public boolean startMovingAlong​(@Nullable Path path, double speed)
    • getCurrentPath

      @Nullable public Path getCurrentPath()
    • tick

      public void tick()
    • continueFollowingPath

      protected void continueFollowingPath()
    • method_27799

      private boolean method_27799​(Vec3d vec3d)
    • checkTimeouts

      protected void checkTimeouts​(Vec3d currentPos)
    • resetNodeAndStop

      private void resetNodeAndStop()
    • resetNode

      private void resetNode()
    • isIdle

      public boolean isIdle()
    • isFollowingPath

      public boolean isFollowingPath()
    • stop

      public void stop()
    • getPos

      protected abstract Vec3d getPos()
      The position to act as if the entity is at for pathfinding purposes
    • isAtValidPosition

      protected abstract boolean isAtValidPosition()
    • isInLiquid

      protected boolean isInLiquid()
    • adjustPath

      protected void adjustPath()
      Adjusts the current path according to various special obstacles that may be in the way, for example sunlight
    • canPathDirectlyThrough

      protected abstract boolean canPathDirectlyThrough​(Vec3d origin, Vec3d target, int sizeX, int sizeY, int sizeZ)
    • isValidPosition

      public boolean isValidPosition​(BlockPos pos)
    • getNodeMaker

      public PathNodeMaker getNodeMaker()
    • setCanSwim

      public void setCanSwim​(boolean canSwim)
    • canSwim

      public boolean canSwim()
    • onBlockChanged

      public void onBlockChanged​(BlockPos pos)
    • isNearPathStartPos

      public boolean isNearPathStartPos()