Class Combat

java.lang.Object
studio.magemonkey.fabled.api.util.Combat

public class Combat extends Object
Helper method for checking whether an entity is in combat
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    applyCombat(org.bukkit.entity.Player player)
    Updates the combat status of the player
    static void
    clearData(org.bukkit.entity.Player player)
    Clears the combat timer data for the given player
    static boolean
    isInCombat(org.bukkit.entity.Player player, double seconds)
    Checks whether the player is in combat or not
    static boolean
    isOutOfCombat(org.bukkit.entity.Player player, double seconds)
    Checks whether the player is out of combat or not

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Combat

      public Combat()
  • Method Details

    • applyCombat

      public static void applyCombat(org.bukkit.entity.Player player)
      Updates the combat status of the player
      Parameters:
      player - player to mark as starting combat
    • clearData

      public static void clearData(org.bukkit.entity.Player player)
      Clears the combat timer data for the given player
      Parameters:
      player - player to clear for
    • isInCombat

      public static boolean isInCombat(org.bukkit.entity.Player player, double seconds)
      Checks whether the player is in combat or not
      Parameters:
      player - player to check for
      seconds - seconds before being counted as in combat
      Returns:
      true if in combat, false otherwise
    • isOutOfCombat

      public static boolean isOutOfCombat(org.bukkit.entity.Player player, double seconds)
      Checks whether the player is out of combat or not
      Parameters:
      player - player to check for
      seconds - seconds before being counted as out of combat
      Returns:
      true if out of combat, false otherwise