Class MeleeAttackGoal

java.lang.Object
net.minestom.server.entity.ai.GoalSelector
net.minestom.server.entity.ai.goal.MeleeAttackGoal

public class MeleeAttackGoal extends GoalSelector
Attacks the entity's target (EntityCreature.getTarget()) OR the closest entity which can be targeted with the entity TargetSelector.
  • Constructor Details

    • MeleeAttackGoal

      public MeleeAttackGoal(@NotNull @NotNull EntityCreature entityCreature, double range, int delay, @NotNull @NotNull TemporalUnit timeUnit)
      Parameters:
      entityCreature - the entity to add the goal to
      range - the allowed range the entity can attack others.
      delay - the delay between each attacks
      timeUnit - the unit of the delay
    • MeleeAttackGoal

      public MeleeAttackGoal(@NotNull @NotNull EntityCreature entityCreature, double range, Duration delay)
      Parameters:
      entityCreature - the entity to add the goal to
      range - the allowed range the entity can attack others.
      delay - the delay between each attacks
  • Method Details