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 net.minecraft.world.entity.ai.goal.MoveToBlockGoal
blockPos, mob, nextStartTick, speedModifier, tryTicks, verticalSearchStart -
Constructor Summary
ConstructorsConstructorDescriptionRemoveBlockGoal(Block pBlockToRemove, PathfinderMob pRemoverMob, double pSpeedModifier, int pSearchRange) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanUse()private BlockPosgetPosWithBlock(BlockPos pPos, BlockGetter pLevel) protected booleanisValidTarget(LevelReader pLevel, BlockPos pPos) Returntrueto set given position as destinationvoidplayBreakSound(Level pLevel, BlockPos pPos) voidplayDestroyProgressSound(LevelAccessor pLevel, BlockPos pPos) voidstart()voidstop()voidtick()Methods inherited from class net.minecraft.world.entity.ai.goal.MoveToBlockGoal
acceptedDistance, canContinueToUse, findNearestBlock, getMoveToTarget, isReachedTarget, moveMobToBlock, nextStartTick, requiresUpdateEveryTick, shouldRecalculatePathMethods inherited from class net.minecraft.world.entity.ai.goal.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 pBlockToRemove, PathfinderMob pRemoverMob, double pSpeedModifier, int pSearchRange)
-
-
Method Details
-
canUse
public boolean canUse()- Overrides:
canUsein classMoveToBlockGoal
-
stop
public void 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
-