Class Fox.FoxEatBerriesGoal
java.lang.Object
net.minecraft.world.entity.ai.goal.Goal
net.minecraft.world.entity.ai.goal.MoveToBlockGoal
net.minecraft.world.entity.animal.Fox.FoxEatBerriesGoal
- Enclosing class:
Fox
-
Nested Class Summary
-
Field Summary
FieldsFields inherited from class net.minecraft.world.entity.ai.goal.MoveToBlockGoal
blockPos, mob, nextStartTick, speedModifier, tryTicks, verticalSearchStart
-
Constructor Summary
ConstructorsConstructorDescriptionFoxEatBerriesGoal
(double pSpeedModifier, int pSearchRange, int pVerticalSearchRange) -
Method Summary
Modifier and TypeMethodDescriptiondouble
boolean
canUse()
protected boolean
isValidTarget
(LevelReader pLevel, BlockPos pPos) Returntrue
to set given position as destinationprotected void
private void
pickGlowBerry
(BlockState pState) private void
pickSweetBerries
(BlockState pState) boolean
void
start()
void
tick()
Methods inherited from class net.minecraft.world.entity.ai.goal.MoveToBlockGoal
canContinueToUse, findNearestBlock, getMoveToTarget, isReachedTarget, moveMobToBlock, nextStartTick, requiresUpdateEveryTick
Methods inherited from class net.minecraft.world.entity.ai.goal.Goal
adjustedTickDelay, getFlags, isInterruptable, reducedTickDelay, setFlags, stop, toString
-
Field Details
-
WAIT_TICKS
private static final int WAIT_TICKS- See Also:
-
ticksWaited
protected int ticksWaited
-
-
Constructor Details
-
FoxEatBerriesGoal
public FoxEatBerriesGoal(double pSpeedModifier, int pSearchRange, int pVerticalSearchRange)
-
-
Method Details
-
acceptedDistance
public double acceptedDistance()- Overrides:
acceptedDistance
in classMoveToBlockGoal
-
shouldRecalculatePath
public boolean shouldRecalculatePath()- Overrides:
shouldRecalculatePath
in classMoveToBlockGoal
-
isValidTarget
Returntrue
to set given position as destination- Specified by:
isValidTarget
in classMoveToBlockGoal
-
tick
public void tick()- Overrides:
tick
in classMoveToBlockGoal
-
onReachedTarget
protected void onReachedTarget() -
pickGlowBerry
-
pickSweetBerries
-
canUse
public boolean canUse()- Overrides:
canUse
in classMoveToBlockGoal
-
start
public void start()- Overrides:
start
in classMoveToBlockGoal
-