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 speedModifier, int searchRange, int verticalSearchRange) -
Method Summary
Modifier and TypeMethodDescriptiondoublebooleancanUse()protected booleanisValidTarget(LevelReader level, BlockPos pos) Returntrueto set given position as destinationprotected voidprivate voidpickGlowBerry(BlockState state) private voidpickSweetBerries(BlockState state) booleanvoidstart()voidtick()Methods inherited from class net.minecraft.world.entity.ai.goal.MoveToBlockGoal
canContinueToUse, findNearestBlock, getMoveToTarget, isReachedTarget, moveMobToBlock, nextStartTick, requiresUpdateEveryTickMethods 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 speedModifier, int searchRange, int verticalSearchRange)
-
-
Method Details
-
acceptedDistance
public double acceptedDistance()- Overrides:
acceptedDistancein classMoveToBlockGoal
-
shouldRecalculatePath
public boolean shouldRecalculatePath()- Overrides:
shouldRecalculatePathin classMoveToBlockGoal
-
isValidTarget
Returntrueto set given position as destination- Specified by:
isValidTargetin classMoveToBlockGoal
-
tick
public void tick()- Overrides:
tickin classMoveToBlockGoal
-
onReachedTarget
protected void onReachedTarget() -
pickGlowBerry
-
pickSweetBerries
-
canUse
public boolean canUse()- Overrides:
canUsein classMoveToBlockGoal
-
start
public void start()- Overrides:
startin classMoveToBlockGoal
-