Package net.minecraft.entity.ai.pathing
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 Summary
Fields Modifier and Type Field Description private booleanavoidSunlightFields inherited from class net.minecraft.entity.ai.pathing.EntityNavigation
currentNodeMs, currentNodeTimeout, currentPath, entity, lastActiveTickMs, lastNodePosition, lastRecalculateTime, nodeMaker, nodeReachProximity, pathStartPos, pathStartTime, shouldRecalculate, speed, tickCount, world -
Constructor Summary
Constructors Constructor Description MobNavigation(MobEntity mob, World world) -
Method Summary
Modifier and Type Method Description protected voidadjustPath()Adjusts the current path according to various special obstacles that may be in the way, for example sunlightprivate booleanallVisibleArePassable(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 throughprivate booleanallVisibleAreSafe(int centerX, int centerY, int centerZ, int xSize, int ySize, int zSize, Vec3d entityPos, double lookVecX, double lookVecZ)booleancanEnterOpenDoors()protected booleancanPathDirectlyThrough(Vec3d origin, Vec3d target, int sizeX, int sizeY, int sizeZ)protected booleancanWalkOnPath(PathNodeType pathType)protected PathNodeNavigatorcreatePathNodeNavigator(int range)PathfindPathTo(Entity entity, int distance)PathfindPathTo(BlockPos target, int distance)private intgetPathfindingY()The y-position to act as if the entity is at for pathfinding purposesprotected Vec3dgetPos()The position to act as if the entity is at for pathfinding purposesprotected booleanisAtValidPosition()voidsetAvoidSunlight(boolean avoidSunlight)voidsetCanPathThroughDoors(boolean canPathThroughDoors)Methods inherited from class net.minecraft.entity.ai.pathing.EntityNavigation
canSwim, checkTimeouts, continueFollowingPath, findPathTo, findPathToAny, findPathToAny, getCurrentPath, getNodeMaker, getTargetPos, isFollowingPath, isIdle, isInLiquid, isNearPathStartPos, isValidPosition, method_29934, onBlockChanged, recalculatePath, resetRangeMultiplier, setCanSwim, setRangeMultiplier, setSpeed, shouldRecalculatePath, startMovingAlong, startMovingTo, startMovingTo, stop, tick
-
Field Details
-
avoidSunlight
private boolean avoidSunlight
-
-
Constructor Details
-
MobNavigation
-
-
Method Details
-
isAtValidPosition
protected boolean isAtValidPosition()- Specified by:
isAtValidPositionin classEntityNavigation
-
getPos
The position to act as if the entity is at for pathfinding purposes- Specified by:
getPosin classEntityNavigation
-
findPathTo
- Overrides:
findPathToin classEntityNavigation
-
findPathTo
- Overrides:
findPathToin classEntityNavigation
-
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:
adjustPathin classEntityNavigation
-
canPathDirectlyThrough
protected boolean canPathDirectlyThrough(Vec3d origin, Vec3d target, int sizeX, int sizeY, int sizeZ)- Specified by:
canPathDirectlyThroughin classEntityNavigation
-
allVisibleAreSafe
private boolean allVisibleAreSafe(int centerX, int centerY, int centerZ, int xSize, int ySize, int zSize, Vec3d entityPos, double lookVecX, double lookVecZ) -
canWalkOnPath
-
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)