Package net.minecraft.entity.ai.goal
Class BreakBlockGoal
- java.lang.Object
-
- net.minecraft.entity.ai.goal.Goal
-
- net.minecraft.entity.ai.goal.MoveToBlockGoal
-
- net.minecraft.entity.ai.goal.BreakBlockGoal
-
- Direct Known Subclasses:
ZombieEntity.AttackTurtleEggGoal
public class BreakBlockGoal extends MoveToBlockGoal
-
-
Field Summary
Fields Modifier and Type Field Description private Block
blockToRemove
private MobEntity
removerMob
private int
ticksSinceReachedGoal
-
Fields inherited from class net.minecraft.entity.ai.goal.MoveToBlockGoal
blockPos, mob, nextStartTick, speedModifier, tryTicks, verticalSearchStart
-
-
Constructor Summary
Constructors Constructor Description BreakBlockGoal(Block p_i48795_1_, CreatureEntity p_i48795_2_, double p_i48795_3_, int p_i48795_5_)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canUse()
private BlockPos
getPosWithBlock(BlockPos p_203115_1_, IBlockReader p_203115_2_)
protected boolean
isValidTarget(IWorldReader p_179488_1_, BlockPos p_179488_2_)
void
playBreakSound(World p_203116_1_, BlockPos p_203116_2_)
void
playDestroyProgressSound(IWorld p_203114_1_, BlockPos p_203114_2_)
void
start()
void
stop()
void
tick()
private boolean
tryFindBlock()
-
Methods inherited from class net.minecraft.entity.ai.goal.MoveToBlockGoal
acceptedDistance, canContinueToUse, findNearestBlock, getMoveToTarget, isReachedTarget, moveMobToBlock, nextStartTick, shouldRecalculatePath
-
Methods inherited from class net.minecraft.entity.ai.goal.Goal
getFlags, isInterruptable, setFlags, toString
-
-
-
-
Constructor Detail
-
BreakBlockGoal
public BreakBlockGoal(Block p_i48795_1_, CreatureEntity p_i48795_2_, double p_i48795_3_, int p_i48795_5_)
-
-
Method Detail
-
canUse
public boolean canUse()
- Overrides:
canUse
in classMoveToBlockGoal
-
tryFindBlock
private boolean tryFindBlock()
-
start
public void start()
- Overrides:
start
in classMoveToBlockGoal
-
playDestroyProgressSound
public void playDestroyProgressSound(IWorld p_203114_1_, BlockPos p_203114_2_)
-
tick
public void tick()
- Overrides:
tick
in classMoveToBlockGoal
-
getPosWithBlock
@Nullable private BlockPos getPosWithBlock(BlockPos p_203115_1_, IBlockReader p_203115_2_)
-
isValidTarget
protected boolean isValidTarget(IWorldReader p_179488_1_, BlockPos p_179488_2_)
- Specified by:
isValidTarget
in classMoveToBlockGoal
-
-