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 blockToRemove, PathfinderMob removerMob, double speedModifier, int searchRange) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanUse()private 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 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, 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 removerMob, double speedModifier, int searchRange)
-
-
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
-