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
public class MeleeAttackGoal extends Goal
-
-
Field Summary
Fields Modifier and Type Field Description private int
attackInterval
private boolean
canPenalize
private int
failedPathFindingPenalty
private boolean
followingTargetEvenIfNotSeen
private long
lastCanUseCheck
protected CreatureEntity
mob
private Path
path
private double
pathedTargetX
private double
pathedTargetY
private double
pathedTargetZ
private double
speedModifier
private int
ticksUntilNextAttack
private int
ticksUntilNextPathRecalculation
-
Constructor Summary
Constructors Constructor Description MeleeAttackGoal(CreatureEntity p_i1636_1_, double p_i1636_2_, boolean p_i1636_4_)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canContinueToUse()
boolean
canUse()
protected void
checkAndPerformAttack(LivingEntity p_190102_1_, double p_190102_2_)
protected int
getAttackInterval()
protected double
getAttackReachSqr(LivingEntity p_179512_1_)
protected int
getTicksUntilNextAttack()
protected boolean
isTimeToAttack()
protected void
resetAttackCooldown()
void
start()
void
stop()
void
tick()
-
Methods inherited from class net.minecraft.entity.ai.goal.Goal
getFlags, isInterruptable, setFlags, toString
-
-
-
-
Field Detail
-
mob
protected final CreatureEntity mob
-
speedModifier
private final double speedModifier
-
followingTargetEvenIfNotSeen
private final boolean followingTargetEvenIfNotSeen
-
path
private Path 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
-
failedPathFindingPenalty
private int failedPathFindingPenalty
-
canPenalize
private boolean canPenalize
-
-
Constructor Detail
-
MeleeAttackGoal
public MeleeAttackGoal(CreatureEntity p_i1636_1_, double p_i1636_2_, boolean p_i1636_4_)
-
-
Method Detail
-
canContinueToUse
public boolean canContinueToUse()
- Overrides:
canContinueToUse
in classGoal
-
checkAndPerformAttack
protected void checkAndPerformAttack(LivingEntity p_190102_1_, double p_190102_2_)
-
resetAttackCooldown
protected void resetAttackCooldown()
-
isTimeToAttack
protected boolean isTimeToAttack()
-
getTicksUntilNextAttack
protected int getTicksUntilNextAttack()
-
getAttackInterval
protected int getAttackInterval()
-
getAttackReachSqr
protected double getAttackReachSqr(LivingEntity p_179512_1_)
-
-