Class RangedAttackGoal

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

public class RangedAttackGoal extends GoalSelector
  • Constructor Details

    • RangedAttackGoal

      public RangedAttackGoal(@NotNull @NotNull EntityCreature entityCreature, int delay, int attackRange, int desirableRange, boolean comeClose, double power, double spread, @NotNull @NotNull TemporalUnit timeUnit)
      Parameters:
      entityCreature - the entity to add the goal to.
      delay - the delay between each shots.
      attackRange - the allowed range the entity can shoot others.
      desirableRange - the desirable range: the entity will try to stay no further than this distance.
      comeClose - whether entity should go as close as possible to the target whether target is not in line of sight.
      power - shot power (1 for normal).
      spread - shot spread (0 for best accuracy).
      timeUnit - the unit of the delay.
    • RangedAttackGoal

      public RangedAttackGoal(@NotNull @NotNull EntityCreature entityCreature, Duration delay, int attackRange, int desirableRange, boolean comeClose, double power, double spread)
      Parameters:
      entityCreature - the entity to add the goal to.
      delay - the delay between each shots.
      attackRange - the allowed range the entity can shoot others.
      desirableRange - the desirable range: the entity will try to stay no further than this distance.
      comeClose - whether entity should go as close as possible to the target whether target is not in line of sight.
      power - shot power (1 for normal).
      spread - shot spread (0 for best accuracy).
  • Method Details