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, SpiderEntity.AttackGoal, ZombieAttackGoal

public class MeleeAttackGoal extends Goal
Mappings:
Namespace Name
named net/minecraft/entity/ai/goal/MeleeAttackGoal
intermediary net/minecraft/class_1366
official cdn
  • Field Details

    • MAX_ATTACK_TIME

      private static final long MAX_ATTACK_TIME
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named MAX_ATTACK_TIME Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;MAX_ATTACK_TIME:J
      intermediary field_30218 Lnet/minecraft/class_1366;field_30218:J
      official l Lcdn;l:J
    • mob

      protected final PathAwareEntity mob
      Mappings:
      Namespace Name Mixin selector
      named mob Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;mob:Lnet/minecraft/entity/mob/PathAwareEntity;
      intermediary field_6503 Lnet/minecraft/class_1366;field_6503:Lnet/minecraft/class_1314;
      official a Lcdn;a:Lbwn;
    • speed

      private final double speed
      Mappings:
      Namespace Name Mixin selector
      named speed Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;speed:D
      intermediary field_6500 Lnet/minecraft/class_1366;field_6500:D
      official b Lcdn;b:D
    • pauseWhenMobIdle

      private final boolean pauseWhenMobIdle
      Mappings:
      Namespace Name Mixin selector
      named pauseWhenMobIdle Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;pauseWhenMobIdle:Z
      intermediary field_6502 Lnet/minecraft/class_1366;field_6502:Z
      official c Lcdn;c:Z
    • path

      private Path path
      Mappings:
      Namespace Name Mixin selector
      named path Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;path:Lnet/minecraft/entity/ai/pathing/Path;
      intermediary field_6509 Lnet/minecraft/class_1366;field_6509:Lnet/minecraft/class_11;
      official d Lcdn;d:Leuk;
    • targetX

      private double targetX
      Mappings:
      Namespace Name Mixin selector
      named targetX Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;targetX:D
      intermediary field_6508 Lnet/minecraft/class_1366;field_6508:D
      official e Lcdn;e:D
    • targetY

      private double targetY
      Mappings:
      Namespace Name Mixin selector
      named targetY Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;targetY:D
      intermediary field_6507 Lnet/minecraft/class_1366;field_6507:D
      official f Lcdn;f:D
    • targetZ

      private double targetZ
      Mappings:
      Namespace Name Mixin selector
      named targetZ Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;targetZ:D
      intermediary field_6506 Lnet/minecraft/class_1366;field_6506:D
      official g Lcdn;g:D
    • updateCountdownTicks

      private int updateCountdownTicks
      Mappings:
      Namespace Name Mixin selector
      named updateCountdownTicks Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;updateCountdownTicks:I
      intermediary field_6501 Lnet/minecraft/class_1366;field_6501:I
      official h Lcdn;h:I
    • cooldown

      private int cooldown
      Mappings:
      Namespace Name Mixin selector
      named cooldown Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;cooldown:I
      intermediary field_24667 Lnet/minecraft/class_1366;field_24667:I
      official i Lcdn;i:I
    • attackIntervalTicks

      private final int attackIntervalTicks
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named attackIntervalTicks Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;attackIntervalTicks:I
      intermediary field_6504 Lnet/minecraft/class_1366;field_6504:I
      official j Lcdn;j:I
    • lastUpdateTime

      private long lastUpdateTime
      Mappings:
      Namespace Name Mixin selector
      named lastUpdateTime Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;lastUpdateTime:J
      intermediary field_19200 Lnet/minecraft/class_1366;field_19200:J
      official k Lcdn;k:J
  • Constructor Details

    • MeleeAttackGoal

      public MeleeAttackGoal(PathAwareEntity mob, double speed, boolean pauseWhenMobIdle)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;<init>(Lnet/minecraft/entity/mob/PathAwareEntity;DZ)V
      intermediary <init> Lnet/minecraft/class_1366;<init>(Lnet/minecraft/class_1314;DZ)V
      official <init> Lcdn;<init>(Lbwn;DZ)V
  • Method Details

    • canStart

      public boolean canStart()
      Specified by:
      canStart in class Goal
      Mappings:
      Namespace Name Mixin selector
      named canStart Lnet/minecraft/entity/ai/goal/Goal;canStart()Z
      intermediary method_6264 Lnet/minecraft/class_1352;method_6264()Z
      official b Lcdd;b()Z
    • shouldContinue

      public boolean shouldContinue()
      Overrides:
      shouldContinue in class Goal
      Mappings:
      Namespace Name Mixin selector
      named shouldContinue Lnet/minecraft/entity/ai/goal/Goal;shouldContinue()Z
      intermediary method_6266 Lnet/minecraft/class_1352;method_6266()Z
      official c Lcdd;c()Z
    • start

      public void start()
      Overrides:
      start in class Goal
      Mappings:
      Namespace Name Mixin selector
      named start Lnet/minecraft/entity/ai/goal/Goal;start()V
      intermediary method_6269 Lnet/minecraft/class_1352;method_6269()V
      official d Lcdd;d()V
    • stop

      public void stop()
      Overrides:
      stop in class Goal
      Mappings:
      Namespace Name Mixin selector
      named stop Lnet/minecraft/entity/ai/goal/Goal;stop()V
      intermediary method_6270 Lnet/minecraft/class_1352;method_6270()V
      official e Lcdd;e()V
    • shouldRunEveryTick

      public boolean shouldRunEveryTick()
      Returns if the goal should run every tick or not.

      This returns false by default. If this returns false, the goal will tick once after the entity is spawned, and will tick every other tick.

      Overrides:
      shouldRunEveryTick in class Goal
      Returns:
      if the goal should run every tick or not
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named shouldRunEveryTick Lnet/minecraft/entity/ai/goal/Goal;shouldRunEveryTick()Z
      intermediary method_38846 Lnet/minecraft/class_1352;method_38846()Z
      official V_ Lcdd;V_()Z
    • tick

      public void tick()
      Overrides:
      tick in class Goal
      Mappings:
      Namespace Name Mixin selector
      named tick Lnet/minecraft/entity/ai/goal/Goal;tick()V
      intermediary method_6268 Lnet/minecraft/class_1352;method_6268()V
      official a Lcdd;a()V
    • attack

      protected void attack(LivingEntity target)
      Mappings:
      Namespace Name Mixin selector
      named attack Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;attack(Lnet/minecraft/entity/LivingEntity;)V
      intermediary method_6288 Lnet/minecraft/class_1366;method_6288(Lnet/minecraft/class_1309;)V
      official a Lcdn;a(Lbwf;)V
    • resetCooldown

      protected void resetCooldown()
      Mappings:
      Namespace Name Mixin selector
      named resetCooldown Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;resetCooldown()V
      intermediary method_28346 Lnet/minecraft/class_1366;method_28346()V
      official h Lcdn;h()V
    • isCooledDown

      protected boolean isCooledDown()
      Mappings:
      Namespace Name Mixin selector
      named isCooledDown Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;isCooledDown()Z
      intermediary method_28347 Lnet/minecraft/class_1366;method_28347()Z
      official i Lcdn;i()Z
    • canAttack

      protected boolean canAttack(LivingEntity target)
      Mappings:
      Namespace Name Mixin selector
      named canAttack Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;canAttack(Lnet/minecraft/entity/LivingEntity;)Z
      intermediary method_53715 Lnet/minecraft/class_1366;method_53715(Lnet/minecraft/class_1309;)Z
      official b Lcdn;b(Lbwf;)Z
    • getCooldown

      protected int getCooldown()
      Mappings:
      Namespace Name Mixin selector
      named getCooldown Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;getCooldown()I
      intermediary method_28348 Lnet/minecraft/class_1366;method_28348()I
      official k Lcdn;k()I
    • getMaxCooldown

      protected int getMaxCooldown()
      Mappings:
      Namespace Name Mixin selector
      named getMaxCooldown Lnet/minecraft/entity/ai/goal/MeleeAttackGoal;getMaxCooldown()I
      intermediary method_28349 Lnet/minecraft/class_1366;method_28349()I
      official l Lcdn;l()I