Class SentinelTargetingHelper

java.lang.Object
org.mcmonkey.sentinel.SentinelHelperObject
org.mcmonkey.sentinel.targeting.SentinelTargetingHelper

public class SentinelTargetingHelper extends SentinelHelperObject
Helper for targeting logic on an NPC.
  • Field Details

  • Constructor Details

    • SentinelTargetingHelper

      public SentinelTargetingHelper()
  • Method Details

    • canSee

      public boolean canSee(org.bukkit.entity.LivingEntity entity)
      Returns whether the NPC can see the target entity.
    • shouldTarget

      public boolean shouldTarget(org.bukkit.entity.LivingEntity entity)
      Returns whether the NPC should target a specific entity.
    • shouldAvoid

      public boolean shouldAvoid(org.bukkit.entity.LivingEntity entity)
      Returns whether the NPC should avoid a specific entity.
    • addAvoid

      public void addAvoid(UUID id)
      Adds a temporary avoid to this NPC.
    • addTarget

      public void addTarget(UUID id)
      Adds a temporary target to this NPC (and squadmates if relevant).
    • removeTarget

      public boolean removeTarget(UUID id)
      Removes a temporary target from this NPC (and squadmates if relevant). Returns whether anything was removed.
    • removeTargetNoBounce

      public boolean removeTargetNoBounce(UUID target)
      Removes a target directly from the NPC. Prefer removeTarget over this in most cases. Returns whether anything was removed.
    • informTargetHasNoLos

      public void informTargetHasNoLos(UUID id)
      Informs the tracker that the given currentTarget UUID is an entity that cannot currently be seen.
    • addTargetNoBounce

      public void addTargetNoBounce(UUID id)
      Adds a target directly to the NPC. Prefer addTarget over this in most cases.
    • isInvisible

      public boolean isInvisible(org.bukkit.entity.LivingEntity entity)
      Returns whether an entity is invisible to this NPC.
    • isIgnored

      public boolean isIgnored(org.bukkit.entity.LivingEntity entity)
      Returns whether an entity is ignored by this NPC's ignore lists.
    • isTargeted

      public boolean isTargeted(org.bukkit.entity.LivingEntity entity)
      Returns whether an entity is targeted by this NPC's target lists. Consider calling 'shouldTarget' instead.
    • isAvoided

      public boolean isAvoided(org.bukkit.entity.LivingEntity entity)
      Returns whether an entity is marked to be avoided by this NPC's avoid lists.
    • processAvoidance

      public void processAvoidance()
      Process avoid necessary avoidance. Builds a list of things we need to run away from, and then runs.
    • findBestRunSpot

      public org.bukkit.Location findBestRunSpot()
      Finds a spot this NPC should run to, to avoid threats. Returns null if there's nowhere to run.
    • findSpotForRunDirection

      public static org.bukkit.Location findSpotForRunDirection(org.bukkit.Location start, double distance, org.bukkit.util.Vector direction)
      Returns a spot to run to if running in a certain direction. Returns null if can't reasonably run that direction.
    • runDirection

      public org.bukkit.Location runDirection(org.bukkit.Location center)
      Returns a direction to run in, avoiding threatening entities as best as possible. Returns a location of the spot to run to. Returns null if nowhere to run.
    • findBestTarget

      public org.bukkit.entity.LivingEntity findBestTarget()
      This method searches for the nearest targetable entity with direct line-of-sight. Failing a direct line of sight, the nearest entity in range at all will be chosen.
    • processAllMultiTargets

      public void processAllMultiTargets()
      Process all current multi-targets. This is an internal call as part of the main logic loop.
    • processMultiTargets

      public void processMultiTargets(SentinelTargetList baseList, SentinelTargetingHelper.TargetListType type)
      Process a specific set of multi-targets. This is an internal call as part of the main logic loop.
    • findQuickMeleeTarget

      public org.bukkit.entity.LivingEntity findQuickMeleeTarget()
      Finds a nearby target that can be hit with a melee attack.
    • updateAvoids

      public void updateAvoids()
      Updates the current avoids set for the NPC. This is an internal call as part of the main logic loop.
    • isUntargetable

      public static boolean isUntargetable(org.bukkit.entity.Entity e)
      Returns whether an entity is not able to be targeted at all.
    • updateTargets

      public void updateTargets()
      Updates the current targets set for the NPC. This is an internal call as part of the main logic loop.