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 Details

    • 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:
    • lastCanUseCheck

      private long lastCanUseCheck
    • failedPathFindingPenalty

      private int failedPathFindingPenalty
    • canPenalize

      private boolean canPenalize
  • Constructor Details

    • MeleeAttackGoal

      public MeleeAttackGoal(CreatureEntity p_i1636_1_, double p_i1636_2_, boolean p_i1636_4_)
  • 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
    • tick

      public void tick()
      Overrides:
      tick in class Goal
    • 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_)