Package net.minecraft.entity.ai.goal
Class StepAndDestroyBlockGoal
java.lang.Object
net.minecraft.entity.ai.goal.Goal
net.minecraft.entity.ai.goal.MoveToTargetPosGoal
net.minecraft.entity.ai.goal.StepAndDestroyBlockGoal
- Direct Known Subclasses:
ZombieEntity.DestroyEggGoal
public class StepAndDestroyBlockGoal extends MoveToTargetPosGoal
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.ai.goal.Goal
Goal.Control
-
Field Summary
Fields Modifier and Type Field Description private int
counter
private MobEntity
stepAndDestroyMob
private Block
targetBlock
Fields inherited from class net.minecraft.entity.ai.goal.MoveToTargetPosGoal
cooldown, lowestY, mob, speed, targetPos, tryingTime
-
Constructor Summary
Constructors Constructor Description StepAndDestroyBlockGoal(Block targetBlock, PathAwareEntity mob, double speed, int maxYDifference)
-
Method Summary
Modifier and Type Method Description boolean
canStart()
private boolean
hasAvailableTarget()
protected boolean
isTargetPos(WorldView world, BlockPos pos)
void
onDestroyBlock(World world, BlockPos pos)
void
start()
void
stop()
void
tick()
void
tickStepping(WorldAccess world, BlockPos pos)
private BlockPos
tweakToProperPos(BlockPos pos, BlockView world)
Methods inherited from class net.minecraft.entity.ai.goal.MoveToTargetPosGoal
findTargetPos, getDesiredSquaredDistanceToTarget, getInterval, getTargetPos, hasReached, shouldContinue, shouldResetPath, startMovingToTarget
Methods inherited from class net.minecraft.entity.ai.goal.Goal
canStop, getControls, setControls, toString
-
Field Details
-
targetBlock
-
stepAndDestroyMob
-
counter
private int counter
-
-
Constructor Details
-
StepAndDestroyBlockGoal
public StepAndDestroyBlockGoal(Block targetBlock, PathAwareEntity mob, double speed, int maxYDifference)
-
-
Method Details
-
canStart
public boolean canStart()- Overrides:
canStart
in classMoveToTargetPosGoal
-
hasAvailableTarget
private boolean hasAvailableTarget() -
stop
public void stop() -
start
public void start()- Overrides:
start
in classMoveToTargetPosGoal
-
tickStepping
-
onDestroyBlock
-
tick
public void tick()- Overrides:
tick
in classMoveToTargetPosGoal
-
tweakToProperPos
-
isTargetPos
- Specified by:
isTargetPos
in classMoveToTargetPosGoal
-