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 BlockPos
Block to move toprivate static final int
private static final int
private int
protected final PathfinderMob
protected int
Controls task execution delayprivate boolean
private final int
final double
private static final int
protected int
private final int
protected int
-
Constructor Summary
ConstructorsConstructorDescriptionMoveToBlockGoal
(PathfinderMob mob, double speedModifier, int searchRange) MoveToBlockGoal
(PathfinderMob mob, double speedModifier, int searchRange, int verticalSearchRange) -
Method Summary
Modifier and TypeMethodDescriptiondouble
boolean
boolean
canUse()
protected boolean
protected BlockPos
protected boolean
protected abstract boolean
isValidTarget
(LevelReader level, BlockPos pos) Returntrue
to set given position as destinationprotected void
protected int
nextStartTick
(PathfinderMob creature) boolean
boolean
void
start()
void
tick()
Methods inherited from class net.minecraft.world.entity.ai.goal.Goal
adjustedTickDelay, getFlags, 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 nextStartTickControls task execution delay -
tryTicks
protected int tryTicks -
maxStayTicks
private int maxStayTicks -
blockPos
Block to move to -
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
public boolean canUse() -
nextStartTick
-
canContinueToUse
public boolean canContinueToUse()- Overrides:
canContinueToUse
in classGoal
-
start
public void start() -
moveMobToBlock
protected void moveMobToBlock() -
acceptedDistance
public double acceptedDistance() -
getMoveToTarget
-
requiresUpdateEveryTick
public boolean requiresUpdateEveryTick()- Overrides:
requiresUpdateEveryTick
in classGoal
-
tick
public void tick() -
shouldRecalculatePath
public boolean shouldRecalculatePath() -
isReachedTarget
protected boolean isReachedTarget() -
findNearestBlock
protected boolean findNearestBlock() -
isValidTarget
Returntrue
to set given position as destination
-