Package net.minecraft.entity.ai.goal
Class MeleeAttackGoal
java.lang.Object
net.minecraft.entity.ai.goal.Goal
net.minecraft.entity.ai.goal.MeleeAttackGoal
- Direct Known Subclasses:
BeeEntity.StingGoal,FoxEntity.AttackGoal,PandaEntity.AttackGoal,PolarBearEntity.AttackGoal,RabbitEntity.RabbitAttackGoal,RavagerEntity.AttackGoal,SpiderEntity.AttackGoal,VindicatorEntity.AttackGoal,ZombieAttackGoal
public class MeleeAttackGoal extends Goal
-
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 intattackIntervalTicksprivate intfield_24667private longlastUpdateTimeprotected PathAwareEntitymobprivate Pathpathprivate booleanpauseWhenMobIdleprivate doublespeedprivate doubletargetXprivate doubletargetYprivate doubletargetZprivate intupdateCountdownTicks -
Constructor Summary
Constructors Constructor Description MeleeAttackGoal(PathAwareEntity mob, double speed, boolean pauseWhenMobIdle) -
Method Summary
Modifier and Type Method Description protected voidattack(LivingEntity target, double squaredDistance)booleancanStart()protected doublegetSquaredMaxAttackDistance(LivingEntity entity)protected voidmethod_28346()protected booleanmethod_28347()protected intmethod_28348()protected intmethod_28349()booleanshouldContinue()voidstart()voidstop()voidtick()Methods inherited from class net.minecraft.entity.ai.goal.Goal
canStop, getControls, setControls, toString
-
Field Details
-
mob
-
speed
private final double speed -
pauseWhenMobIdle
private final boolean pauseWhenMobIdle -
path
-
targetX
private double targetX -
targetY
private double targetY -
targetZ
private double targetZ -
updateCountdownTicks
private int updateCountdownTicks -
field_24667
private int field_24667 -
attackIntervalTicks
private final int attackIntervalTicks- See Also:
- Constant Field Values
-
lastUpdateTime
private long lastUpdateTime
-
-
Constructor Details
-
MeleeAttackGoal
-
-
Method Details
-
canStart
public boolean canStart() -
shouldContinue
public boolean shouldContinue()- Overrides:
shouldContinuein classGoal
-
start
public void start() -
stop
public void stop() -
tick
public void tick() -
attack
-
method_28346
protected void method_28346() -
method_28347
protected boolean method_28347() -
method_28348
protected int method_28348() -
method_28349
protected int method_28349() -
getSquaredMaxAttackDistance
-