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 intcounterprivate MobEntitystepAndDestroyMobprivate BlocktargetBlockFields 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 booleancanStart()private booleanhasAvailableTarget()protected booleanisTargetPos(WorldView world, BlockPos pos)voidonDestroyBlock(World world, BlockPos pos)voidstart()voidstop()voidtick()voidtickStepping(WorldAccess world, BlockPos pos)private BlockPostweakToProperPos(BlockPos pos, BlockView world)Methods inherited from class net.minecraft.entity.ai.goal.MoveToTargetPosGoal
findTargetPos, getDesiredSquaredDistanceToTarget, getInterval, getTargetPos, hasReached, shouldContinue, shouldResetPath, startMovingToTargetMethods 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:
canStartin classMoveToTargetPosGoal
-
hasAvailableTarget
private boolean hasAvailableTarget() -
stop
public void stop() -
start
public void start()- Overrides:
startin classMoveToTargetPosGoal
-
tickStepping
-
onDestroyBlock
-
tick
public void tick()- Overrides:
tickin classMoveToTargetPosGoal
-
tweakToProperPos
-
isTargetPos
- Specified by:
isTargetPosin classMoveToTargetPosGoal
-