Class MobNavigation

java.lang.Object
net.minecraft.entity.ai.pathing.EntityNavigation
net.minecraft.entity.ai.pathing.MobNavigation
Direct Known Subclasses:
RavagerEntity.Navigation, SpiderNavigation, StriderEntity.Navigation

public class MobNavigation
extends EntityNavigation
  • Field Details

    • avoidSunlight

      private boolean avoidSunlight
  • Constructor Details

    • MobNavigation

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

    • createPathNodeNavigator

      protected PathNodeNavigator createPathNodeNavigator​(int range)
      Specified by:
      createPathNodeNavigator in class EntityNavigation
    • isAtValidPosition

      protected boolean isAtValidPosition()
      Specified by:
      isAtValidPosition in class EntityNavigation
    • getPos

      protected Vec3d getPos()
      The position to act as if the entity is at for pathfinding purposes
      Specified by:
      getPos in class EntityNavigation
    • findPathTo

      public Path findPathTo​(BlockPos target, int distance)
      Overrides:
      findPathTo in class EntityNavigation
    • findPathTo

      public Path findPathTo​(Entity entity, int distance)
      Overrides:
      findPathTo in class EntityNavigation
    • getPathfindingY

      private int getPathfindingY()
      The y-position to act as if the entity is at for pathfinding purposes
    • adjustPath

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

      protected boolean canPathDirectlyThrough​(Vec3d origin, Vec3d target, int sizeX, int sizeY, int sizeZ)
      Specified by:
      canPathDirectlyThrough in class EntityNavigation
    • allVisibleAreSafe

      private boolean allVisibleAreSafe​(int centerX, int centerY, int centerZ, int xSize, int ySize, int zSize, Vec3d entityPos, double lookVecX, double lookVecZ)
    • canWalkOnPath

      protected boolean canWalkOnPath​(PathNodeType pathType)
    • allVisibleArePassable

      private boolean allVisibleArePassable​(int x, int y, int z, int xSize, int ySize, int zSize, Vec3d entityPos, double lookVecX, double lookVecZ)
      Checks whether all blocks in the box which are visible (in front of) the mob can be pathed through
    • setCanPathThroughDoors

      public void setCanPathThroughDoors​(boolean canPathThroughDoors)
    • canEnterOpenDoors

      public boolean canEnterOpenDoors()
    • setAvoidSunlight

      public void setAvoidSunlight​(boolean avoidSunlight)