Package net.minecraft.entity.ai.goal
Class MoveToTargetPosGoal
java.lang.Object
net.minecraft.entity.ai.goal.Goal
net.minecraft.entity.ai.goal.MoveToTargetPosGoal
- Direct Known Subclasses:
CatSitOnBlockGoal,DrownedEntity.LeaveWaterGoal,FoxEntity.EatSweetBerriesGoal,GoToOwnerAndPurrGoal,RabbitEntity.EatCarrotCropGoal,StepAndDestroyBlockGoal,StriderEntity.GoBackToLavaGoal,TurtleEntity.LayEggGoal,TurtleEntity.WanderInWaterGoal
public abstract class MoveToTargetPosGoal extends Goal
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.ai.goal.Goal
Goal.Control -
Field Summary
Fields Modifier and Type Field Description protected intcooldownprotected intlowestYprivate intmaxYDifferenceprotected PathAwareEntitymobprivate intrangeprivate booleanreachedprivate intsafeWaitingTimedoublespeedprotected BlockPostargetPosprotected inttryingTime -
Constructor Summary
Constructors Constructor Description MoveToTargetPosGoal(PathAwareEntity mob, double speed, int range)MoveToTargetPosGoal(PathAwareEntity mob, double speed, int range, int maxYDifference) -
Method Summary
Modifier and Type Method Description booleancanStart()protected booleanfindTargetPos()doublegetDesiredSquaredDistanceToTarget()protected intgetInterval(PathAwareEntity mob)protected BlockPosgetTargetPos()protected booleanhasReached()protected abstract booleanisTargetPos(WorldView world, BlockPos pos)booleanshouldContinue()booleanshouldResetPath()voidstart()protected voidstartMovingToTarget()voidtick()Methods inherited from class net.minecraft.entity.ai.goal.Goal
canStop, getControls, setControls, stop, toString
-
Field Details
-
mob
-
speed
public final double speed -
cooldown
protected int cooldown -
tryingTime
protected int tryingTime -
safeWaitingTime
private int safeWaitingTime -
targetPos
-
reached
private boolean reached -
range
private final int range -
maxYDifference
private final int maxYDifference -
lowestY
protected int lowestY
-
-
Constructor Details
-
MoveToTargetPosGoal
-
MoveToTargetPosGoal
-
-
Method Details
-
canStart
public boolean canStart() -
getInterval
-
shouldContinue
public boolean shouldContinue()- Overrides:
shouldContinuein classGoal
-
start
public void start() -
startMovingToTarget
protected void startMovingToTarget() -
getDesiredSquaredDistanceToTarget
public double getDesiredSquaredDistanceToTarget() -
getTargetPos
-
tick
public void tick() -
shouldResetPath
public boolean shouldResetPath() -
hasReached
protected boolean hasReached() -
findTargetPos
protected boolean findTargetPos() -
isTargetPos
-