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 Block
private final Mob
private int
private static final int
Fields 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 TypeMethodDescriptionboolean
canUse()
private BlockPos
getPosWithBlock
(BlockPos pPos, BlockGetter pLevel) protected boolean
isValidTarget
(LevelReader pLevel, BlockPos pPos) Returntrue
to set given position as destinationvoid
playBreakSound
(Level pLevel, BlockPos pPos) void
playDestroyProgressSound
(LevelAccessor pLevel, BlockPos pPos) void
start()
void
stop()
void
tick()
Methods inherited from class net.minecraft.world.entity.ai.goal.MoveToBlockGoal
acceptedDistance, canContinueToUse, findNearestBlock, getMoveToTarget, isReachedTarget, moveMobToBlock, nextStartTick, requiresUpdateEveryTick, shouldRecalculatePath
Methods 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 pBlockToRemove, PathfinderMob pRemoverMob, double pSpeedModifier, int pSearchRange)
-
-
Method Details
-
canUse
public boolean canUse()- Overrides:
canUse
in classMoveToBlockGoal
-
stop
public void stop() -
start
public void start()- Overrides:
start
in classMoveToBlockGoal
-
playDestroyProgressSound
-
playBreakSound
-
tick
public void tick()- Overrides:
tick
in classMoveToBlockGoal
-
getPosWithBlock
-
isValidTarget
Returntrue
to set given position as destination- Specified by:
isValidTarget
in classMoveToBlockGoal
-