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 intattackIntervalprivate booleancanPenalizeprivate intfailedPathFindingPenaltyprivate booleanfollowingTargetEvenIfNotSeenprivate longlastCanUseCheckprotected CreatureEntitymobprivate Pathpathprivate doublepathedTargetXprivate doublepathedTargetYprivate doublepathedTargetZprivate doublespeedModifierprivate intticksUntilNextAttackprivate intticksUntilNextPathRecalculation
-
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 booleancanContinueToUse()booleancanUse()protected voidcheckAndPerformAttack(LivingEntity p_190102_1_, double p_190102_2_)protected intgetAttackInterval()protected doublegetAttackReachSqr(LivingEntity p_179512_1_)protected intgetTicksUntilNextAttack()protected booleanisTimeToAttack()protected voidresetAttackCooldown()voidstart()voidstop()voidtick()-
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:
canContinueToUsein 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_)
-
-