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

public class MeleeAttackGoal extends Goal
  • Field Details

    • mob

      protected final PathfinderMob 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:
    • lastCanUseCheck

      private long lastCanUseCheck
    • COOLDOWN_BETWEEN_CAN_USE_CHECKS

      private static final long COOLDOWN_BETWEEN_CAN_USE_CHECKS
      See Also:
    • failedPathFindingPenalty

      private int failedPathFindingPenalty
    • canPenalize

      private boolean canPenalize
  • Constructor Details

    • MeleeAttackGoal

      public MeleeAttackGoal(PathfinderMob p_25552_, double p_25553_, boolean p_25554_)
  • Method Details

    • canUse

      public boolean canUse()
      Specified by:
      canUse in class Goal
    • canContinueToUse

      public boolean canContinueToUse()
      Overrides:
      canContinueToUse in class Goal
    • start

      public void start()
      Overrides:
      start in class Goal
    • stop

      public void stop()
      Overrides:
      stop in class Goal
    • requiresUpdateEveryTick

      public boolean requiresUpdateEveryTick()
      Overrides:
      requiresUpdateEveryTick in class Goal
    • tick

      public void tick()
      Overrides:
      tick in class Goal
    • checkAndPerformAttack

      protected void checkAndPerformAttack(LivingEntity p_25557_)
    • resetAttackCooldown

      protected void resetAttackCooldown()
    • isTimeToAttack

      protected boolean isTimeToAttack()
    • canPerformAttack

      protected boolean canPerformAttack(LivingEntity p_301299_)
    • getTicksUntilNextAttack

      protected int getTicksUntilNextAttack()
    • getAttackInterval

      protected int getAttackInterval()