public class MeleeAttackGoal extends Goal
Modifier and Type | Field and Description |
---|---|
protected CreatureEntity |
attacker |
protected int |
attackInterval |
protected int |
attackTick |
Constructor and Description |
---|
MeleeAttackGoal(CreatureEntity creature,
double speedIn,
boolean useLongMemory) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkAndPerformAttack(LivingEntity enemy,
double distToEnemySqr) |
protected double |
getAttackReachSqr(LivingEntity attackTarget) |
void |
resetTask() |
boolean |
shouldContinueExecuting() |
boolean |
shouldExecute() |
void |
startExecuting() |
void |
tick() |
getMutexFlags, isPreemptible, setMutexFlags
protected final CreatureEntity attacker
protected int attackTick
protected final int attackInterval
public MeleeAttackGoal(CreatureEntity creature, double speedIn, boolean useLongMemory)
public boolean shouldExecute()
shouldExecute
in class Goal
public boolean shouldContinueExecuting()
shouldContinueExecuting
in class Goal
public void startExecuting()
startExecuting
in class Goal
protected void checkAndPerformAttack(LivingEntity enemy, double distToEnemySqr)
protected double getAttackReachSqr(LivingEntity attackTarget)