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 boolean
avoidSunlight
Fields 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 void
adjustPath()
Adjusts the current path according to various special obstacles that may be in the way, for example sunlightprivate 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 throughprivate boolean
allVisibleAreSafe(int centerX, int centerY, int centerZ, int xSize, int ySize, int zSize, Vec3d entityPos, double lookVecX, double lookVecZ)
boolean
canEnterOpenDoors()
protected boolean
canPathDirectlyThrough(Vec3d origin, Vec3d target, int sizeX, int sizeY, int sizeZ)
protected boolean
canWalkOnPath(PathNodeType pathType)
protected PathNodeNavigator
createPathNodeNavigator(int range)
Path
findPathTo(Entity entity, int distance)
Path
findPathTo(BlockPos target, int distance)
private int
getPathfindingY()
The y-position to act as if the entity is at for pathfinding purposesprotected Vec3d
getPos()
The position to act as if the entity is at for pathfinding purposesprotected boolean
isAtValidPosition()
void
setAvoidSunlight(boolean avoidSunlight)
void
setCanPathThroughDoors(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:
isAtValidPosition
in classEntityNavigation
-
getPos
The position to act as if the entity is at for pathfinding purposes- Specified by:
getPos
in classEntityNavigation
-
findPathTo
- Overrides:
findPathTo
in classEntityNavigation
-
findPathTo
- Overrides:
findPathTo
in 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:
adjustPath
in classEntityNavigation
-
canPathDirectlyThrough
protected boolean canPathDirectlyThrough(Vec3d origin, Vec3d target, int sizeX, int sizeY, int sizeZ)- Specified by:
canPathDirectlyThrough
in 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)