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 int
attackIntervalTicks
private int
field_24667
private long
lastUpdateTime
protected PathAwareEntity
mob
private Path
path
private boolean
pauseWhenMobIdle
private double
speed
private double
targetX
private double
targetY
private double
targetZ
private int
updateCountdownTicks
-
Constructor Summary
Constructors Constructor Description MeleeAttackGoal(PathAwareEntity mob, double speed, boolean pauseWhenMobIdle)
-
Method Summary
Modifier and Type Method Description protected void
attack(LivingEntity target, double squaredDistance)
boolean
canStart()
protected double
getSquaredMaxAttackDistance(LivingEntity entity)
protected void
method_28346()
protected boolean
method_28347()
protected int
method_28348()
protected int
method_28349()
boolean
shouldContinue()
void
start()
void
stop()
void
tick()
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:
shouldContinue
in 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
-