Enum Class TargetPriority

java.lang.Object
java.lang.Enum<TargetPriority>
de.Keyle.MyPet.api.entity.ai.target.TargetPriority
All Implemented Interfaces:
Serializable, Comparable<TargetPriority>, Constable

public enum TargetPriority extends Enum<TargetPriority>
Determines which targeting goal wins when multiple goals attempt to assign a combat target simultaneously. Higher numeric values take precedence — a goal may only override the current target if its priority is strictly greater than the one that set the existing target.

The scale is intentionally sparse so that third-party integrations (via Bukkit) can slot in without colliding. The sentinel values None (Integer.MIN_VALUE) and Overwrite (Integer.MAX_VALUE) anchor the extremes.

  • Enum Constant Details

    • None

      public static final TargetPriority None
      No target set — always loses to any real priority.
    • Bukkit

      public static final TargetPriority Bukkit
      External target set by another plugin via the Bukkit API.
    • Farm

      public static final TargetPriority Farm
      Target acquired by the Farm (mob-harvesting) behavior.
    • Control

      public static final TargetPriority Control
      Target forced by the player's Control skill (manual aim).
    • GetHurt

      public static final TargetPriority GetHurt
      Retaliatory target — the pet was directly damaged.
    • OwnerHurts

      public static final TargetPriority OwnerHurts
      Target inherited from the owner's outgoing attack.
    • OwnerGetsHurt

      public static final TargetPriority OwnerGetsHurt
      Target inherited from something that damaged the owner.
    • Aggressive

      public static final TargetPriority Aggressive
      Autonomous aggression toward configured mob types.
    • Duel

      public static final TargetPriority Duel
      PvP duel target — highest normal-play priority.
    • Overwrite

      public static final TargetPriority Overwrite
      Unconditional override — always wins. Used by admin commands.
  • Method Details

    • values

      public static TargetPriority[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TargetPriority valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getPriority

      public int getPriority()
      Numeric priority value. Higher wins when two goals compete.
      Returns:
      the priority ordinal for this level