Class RemoveBlockGoal
java.lang.Object
net.minecraft.world.entity.ai.goal.Goal
net.minecraft.world.entity.ai.goal.MoveToBlockGoal
net.minecraft.world.entity.ai.goal.RemoveBlockGoal
- Direct Known Subclasses:
Zombie.ZombieAttackTurtleEggGoal
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Blockprivate final Mobprivate intprivate static final intFields inherited from class MoveToBlockGoal
blockPos, mob, nextStartTick, speedModifier, tryTicks, verticalSearchStart -
Constructor Summary
ConstructorsConstructorDescriptionRemoveBlockGoal(Block blockToRemove, PathfinderMob mob, double speedModifier, int verticalSearchRange) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanUse()private @Nullable BlockPosgetPosWithBlock(BlockPos pos, BlockGetter level) protected booleanisValidTarget(LevelReader level, BlockPos pos) Returntrueto set given position as destinationvoidplayBreakSound(Level level, BlockPos pos) voidplayDestroyProgressSound(LevelAccessor level, BlockPos pos) voidstart()voidstop()voidtick()Methods inherited from class MoveToBlockGoal
acceptedDistance, canContinueToUse, findNearestBlock, getMoveToTarget, isReachedTarget, moveMobToBlock, nextStartTick, requiresUpdateEveryTick, shouldRecalculatePathMethods inherited from class Goal
adjustedTickDelay, getFlags, getServerLevel, getServerLevel, isInterruptable, reducedTickDelay, setFlags, toString
-
Field Details
-
blockToRemove
-
removerMob
-
ticksSinceReachedGoal
private int ticksSinceReachedGoal -
WAIT_AFTER_BLOCK_FOUND
private static final int WAIT_AFTER_BLOCK_FOUND- See Also:
-
-
Constructor Details
-
RemoveBlockGoal
public RemoveBlockGoal(Block blockToRemove, PathfinderMob mob, double speedModifier, int verticalSearchRange)
-
-
Method Details
-
canUse
public boolean canUse()- Overrides:
canUsein classMoveToBlockGoal
-
stop
-
start
public void start()- Overrides:
startin classMoveToBlockGoal
-
playDestroyProgressSound
-
playBreakSound
-
tick
public void tick()- Overrides:
tickin classMoveToBlockGoal
-
getPosWithBlock
-
isValidTarget
Returntrueto set given position as destination- Specified by:
isValidTargetin classMoveToBlockGoal
-