Class MeleeAttackGoal
java.lang.Object
net.minecraft.world.entity.ai.goal.Goal
net.minecraft.world.entity.ai.goal.MeleeAttackGoal
- Direct Known Subclasses:
Bee.BeeAttackGoal
,Fox.FoxMeleeAttackGoal
,Panda.PandaAttackGoal
,PolarBear.PolarBearMeleeAttackGoal
,Rabbit.EvilRabbitAttackGoal
,Ravager.RavagerMeleeAttackGoal
,Spider.SpiderAttackGoal
,Vindicator.VindicatorMeleeAttackGoal
,ZombieAttackGoal
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate int
private boolean
private static long
private int
private boolean
private long
protected PathfinderMob
private Path
private double
private double
private double
private double
private int
private int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
canUse()
protected void
checkAndPerformAttack(LivingEntity p_25557_, double p_25558_)
protected int
protected double
getAttackReachSqr(LivingEntity p_25556_)
protected int
protected boolean
protected void
void
start()
void
stop()
void
tick()
Methods inherited from class net.minecraft.world.entity.ai.goal.Goal
getFlags, isInterruptable, setFlags, toString
-
Field Details
-
mob
-
speedModifier
private final double speedModifier -
followingTargetEvenIfNotSeen
private final boolean followingTargetEvenIfNotSeen -
path
-
pathedTargetX
private double pathedTargetX -
pathedTargetY
private double pathedTargetY -
pathedTargetZ
private double pathedTargetZ -
ticksUntilNextPathRecalculation
private int ticksUntilNextPathRecalculation -
ticksUntilNextAttack
private int ticksUntilNextAttack -
attackInterval
private final int attackInterval- See Also:
- Constant Field Values
-
lastCanUseCheck
private long lastCanUseCheck -
COOLDOWN_BETWEEN_CAN_USE_CHECKS
private static final long COOLDOWN_BETWEEN_CAN_USE_CHECKS- See Also:
- Constant Field Values
-
failedPathFindingPenalty
private int failedPathFindingPenalty -
canPenalize
private boolean canPenalize
-
-
Constructor Details
-
MeleeAttackGoal
-
-
Method Details
-
canUse
public boolean canUse() -
canContinueToUse
public boolean canContinueToUse()- Overrides:
canContinueToUse
in classGoal
-
start
public void start() -
stop
public void stop() -
tick
public void tick() -
checkAndPerformAttack
-
resetAttackCooldown
protected void resetAttackCooldown() -
isTimeToAttack
protected boolean isTimeToAttack() -
getTicksUntilNextAttack
protected int getTicksUntilNextAttack() -
getAttackInterval
protected int getAttackInterval() -
getAttackReachSqr
-