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.BiteGoal,PandaEntity.AttackGoal,PolarBearEntity.MeleeAttackGoal,RabbitEntity.EvilAttackGoal,RavagerEntity.AttackGoal,SpiderEntity.AttackGoal,VindicatorEntity.AttackGoal,ZombieAttackGoal
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate booleanprivate intprivate final booleanprivate longprotected final CreatureEntityprivate Pathprivate doubleprivate doubleprivate doubleprivate final doubleprivate intprivate int -
Constructor Summary
ConstructorsConstructorDescriptionMeleeAttackGoal(CreatureEntity p_i1636_1_, double p_i1636_2_, boolean p_i1636_4_) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancanUse()protected voidcheckAndPerformAttack(LivingEntity p_190102_1_, double p_190102_2_) protected intprotected doublegetAttackReachSqr(LivingEntity p_179512_1_) protected intprotected booleanprotected voidvoidstart()voidstop()voidtick()Methods inherited from class net.minecraft.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:
-
lastCanUseCheck
private long lastCanUseCheck -
failedPathFindingPenalty
private int failedPathFindingPenalty -
canPenalize
private boolean canPenalize
-
-
Constructor Details
-
MeleeAttackGoal
-
-
Method Details
-
canUse
public boolean canUse() -
canContinueToUse
public boolean canContinueToUse()- Overrides:
canContinueToUsein 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
-