Class MoveToBlockGoal
java.lang.Object
net.minecraft.world.entity.ai.goal.Goal
net.minecraft.world.entity.ai.goal.MoveToBlockGoal
- Direct Known Subclasses:
CatLieOnBedGoal, CatSitOnBlockGoal, Drowned.DrownedGoToBeachGoal, Fox.FoxEatBerriesGoal, Rabbit.RaidGardenGoal, RemoveBlockGoal, Strider.StriderGoToLavaGoal, Turtle.TurtleGoToWaterGoal, Turtle.TurtleLayEggGoal
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BlockPosprivate static final intprivate static final intprivate intprotected final PathfinderMobprotected intprivate booleanprivate final intfinal doubleprivate static final intprotected intprivate final intprotected int -
Constructor Summary
ConstructorsConstructorDescriptionMoveToBlockGoal(PathfinderMob mob, double speedModifier, int searchRange) MoveToBlockGoal(PathfinderMob mob, double speedModifier, int searchRange, int verticalSearchRange) -
Method Summary
Modifier and TypeMethodDescriptiondoublebooleanbooleancanUse()protected booleanprotected BlockPosprotected booleanprotected abstract booleanisValidTarget(LevelReader level, BlockPos pos) protected voidprotected intbooleanbooleanvoidstart()voidtick()Methods inherited from class Goal
adjustedTickDelay, getFlags, getServerLevel, getServerLevel, isInterruptable, reducedTickDelay, setFlags, stop, toString
-
Field Details
-
GIVE_UP_TICKS
private static final int GIVE_UP_TICKS- See Also:
-
STAY_TICKS
private static final int STAY_TICKS- See Also:
-
INTERVAL_TICKS
private static final int INTERVAL_TICKS- See Also:
-
mob
-
speedModifier
public final double speedModifier -
nextStartTick
protected int nextStartTick -
tryTicks
protected int tryTicks -
maxStayTicks
private int maxStayTicks -
blockPos
-
reachedTarget
private boolean reachedTarget -
searchRange
private final int searchRange -
verticalSearchRange
private final int verticalSearchRange -
verticalSearchStart
protected int verticalSearchStart
-
-
Constructor Details
-
MoveToBlockGoal
-
MoveToBlockGoal
public MoveToBlockGoal(PathfinderMob mob, double speedModifier, int searchRange, int verticalSearchRange)
-
-
Method Details
-
canUse
-
nextStartTick
-
canContinueToUse
public boolean canContinueToUse()- Overrides:
canContinueToUsein classGoal
-
start
-
moveMobToBlock
protected void moveMobToBlock() -
acceptedDistance
public double acceptedDistance() -
getMoveToTarget
-
requiresUpdateEveryTick
public boolean requiresUpdateEveryTick()- Overrides:
requiresUpdateEveryTickin classGoal
-
tick
-
shouldRecalculatePath
public boolean shouldRecalculatePath() -
isReachedTarget
protected boolean isReachedTarget() -
findNearestBlock
protected boolean findNearestBlock() -
isValidTarget
-