Class MeleeAttackGoal

java.lang.Object
net.minecraft.entity.ai.goal.Goal
net.minecraft.entity.ai.goal.MeleeAttackGoal
Direct Known Subclasses:
BeeEntity.StingGoal, FoxEntity.AttackGoal, PandaEntity.AttackGoal, PolarBearEntity.AttackGoal, RabbitEntity.RabbitAttackGoal, RavagerEntity.AttackGoal, SpiderEntity.AttackGoal, VindicatorEntity.AttackGoal, ZombieAttackGoal

public class MeleeAttackGoal
extends Goal
  • Field Details

    • mob

      protected final PathAwareEntity mob
    • speed

      private final double speed
    • pauseWhenMobIdle

      private final boolean pauseWhenMobIdle
    • path

      private Path path
    • targetX

      private double targetX
    • targetY

      private double targetY
    • targetZ

      private double targetZ
    • updateCountdownTicks

      private int updateCountdownTicks
    • field_24667

      private int field_24667
    • attackIntervalTicks

      private final int attackIntervalTicks
      See Also:
      Constant Field Values
    • lastUpdateTime

      private long lastUpdateTime
  • Constructor Details

    • MeleeAttackGoal

      public MeleeAttackGoal​(PathAwareEntity mob, double speed, boolean pauseWhenMobIdle)
  • Method Details

    • canStart

      public boolean canStart()
      Specified by:
      canStart in class Goal
    • shouldContinue

      public boolean shouldContinue()
      Overrides:
      shouldContinue 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
    • attack

      protected void attack​(LivingEntity target, double squaredDistance)
    • method_28346

      protected void method_28346()
    • method_28347

      protected boolean method_28347()
    • method_28348

      protected int method_28348()
    • method_28349

      protected int method_28349()
    • getSquaredMaxAttackDistance

      protected double getSquaredMaxAttackDistance​(LivingEntity entity)