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,- Spider.SpiderAttackGoal,- ZombieAttackGoal
- 
Nested Class Summary
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final intprivate booleanprivate static final longprivate intprivate final booleanprivate longprotected final PathfinderMobprivate Pathprivate doubleprivate doubleprivate doubleprivate final doubleprivate intprivate int
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanprotected booleancanPerformAttack(LivingEntity p_301299_) booleancanUse()protected voidcheckAndPerformAttack(LivingEntity p_25557_) protected intprotected intprotected booleanbooleanprotected voidvoidstart()voidstop()voidtick()Methods inherited from class net.minecraft.world.entity.ai.goal.GoaladjustedTickDelay, getFlags, isInterruptable, reducedTickDelay, setFlags, toString
- 
Field Details- 
mob
- 
speedModifierprivate final double speedModifier
- 
followingTargetEvenIfNotSeenprivate final boolean followingTargetEvenIfNotSeen
- 
path
- 
pathedTargetXprivate double pathedTargetX
- 
pathedTargetYprivate double pathedTargetY
- 
pathedTargetZprivate double pathedTargetZ
- 
ticksUntilNextPathRecalculationprivate int ticksUntilNextPathRecalculation
- 
ticksUntilNextAttackprivate int ticksUntilNextAttack
- 
attackIntervalprivate final int attackInterval- See Also:
 
- 
lastCanUseCheckprivate long lastCanUseCheck
- 
COOLDOWN_BETWEEN_CAN_USE_CHECKSprivate static final long COOLDOWN_BETWEEN_CAN_USE_CHECKS- See Also:
 
- 
failedPathFindingPenaltyprivate int failedPathFindingPenalty
- 
canPenalizeprivate boolean canPenalize
 
- 
- 
Constructor Details- 
MeleeAttackGoal
 
- 
- 
Method Details- 
canUsepublic boolean canUse()
- 
canContinueToUsepublic boolean canContinueToUse()- Overrides:
- canContinueToUsein class- Goal
 
- 
startpublic void start()
- 
stoppublic void stop()
- 
requiresUpdateEveryTickpublic boolean requiresUpdateEveryTick()- Overrides:
- requiresUpdateEveryTickin class- Goal
 
- 
tickpublic void tick()
- 
checkAndPerformAttack
- 
resetAttackCooldownprotected void resetAttackCooldown()
- 
isTimeToAttackprotected boolean isTimeToAttack()
- 
canPerformAttack
- 
getTicksUntilNextAttackprotected int getTicksUntilNextAttack()
- 
getAttackIntervalprotected int getAttackInterval()
 
-