Package org.bukkit

Interface Raid

All Superinterfaces:
PersistentDataHolder, PersistentDataViewHolder

@NullMarked public interface Raid extends PersistentDataHolder
Represents a raid event.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Represents the status of a Raid.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Gets the amount of ticks this raid has existed.
    int
    Gets the Bad Omen level of this raid.
    Get the boss bar to be displayed for this raid.
    Get the UUID of all heroes in this raid.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Raid identifiers are magic internal values and may or may not be present.
    Gets the center location where the raid occurs.
    Gets all remaining Raider in the present wave.
    int
    Gets the number of raider groups which have spawned.
    Gets the current status of the raid.
    int
    Gets the number of raider groups which would spawn.
    float
    Gets the sum of all raider's health.
    int
    Gets the number of waves in this raid (exclude the additional wave).
    boolean
    Get whether this raid started.
    void
    setBadOmenLevel(int badOmenLevel)
    Sets the Bad Omen level.
    void
    setTotalWaves(int totalWaves)
    Sets the number of waves in this raid.

    Methods inherited from interface org.bukkit.persistence.PersistentDataHolder

    getPersistentDataContainer
  • Method Details

    • isStarted

      boolean isStarted()
      Get whether this raid started.
      Returns:
      whether raid is started
    • getActiveTicks

      long getActiveTicks()
      Gets the amount of ticks this raid has existed.
      Returns:
      active ticks
    • getBadOmenLevel

      int getBadOmenLevel()
      Gets the Bad Omen level of this raid.
      Returns:
      Bad Omen level (between 0 and 5)
    • setBadOmenLevel

      void setBadOmenLevel(int badOmenLevel)
      Sets the Bad Omen level.
      If the level is higher than 1, there will be an additional wave that as strong as the final wave.
      Parameters:
      badOmenLevel - new Bad Omen level (from 0-5)
      Throws:
      IllegalArgumentException - if invalid Bad Omen level
    • getLocation

      Location getLocation()
      Gets the center location where the raid occurs.
      Returns:
      location
    • getStatus

      Raid.RaidStatus getStatus()
      Gets the current status of the raid.
      Do not use this method to check if the raid has been started, call isStarted() instead.
      Returns:
      Raids status
    • getSpawnedGroups

      int getSpawnedGroups()
      Gets the number of raider groups which have spawned.
      Returns:
      total spawned groups
    • getTotalGroups

      int getTotalGroups()
      Gets the number of raider groups which would spawn.
      This also includes the group which spawns in the additional wave (if present).
      Returns:
      total groups
    • getTotalWaves

      int getTotalWaves()
      Gets the number of waves in this raid (exclude the additional wave).
      Returns:
      number of waves
    • setTotalWaves

      void setTotalWaves(int totalWaves)
      Sets the number of waves in this raid.
      Parameters:
      totalWaves - number of waves
      Throws:
      IllegalArgumentException - if totalWaves is negative or zero
      IllegalArgumentException - if totalWaves is larger than 7, which is the most waves a vanilla raid can have.
      IllegalArgumentException - if the totalWaves is less than getSpawnedGroups()
    • getTotalHealth

      float getTotalHealth()
      Gets the sum of all raider's health.
      Returns:
      total raiders health
    • getHeroes

      Set<UUID> getHeroes()
      Get the UUID of all heroes in this raid.
      Returns:
      a set of unique ids
    • getRaiders

      List<Raider> getRaiders()
      Gets all remaining Raider in the present wave.
      Returns:
      a list of current raiders
    • getId

      @Deprecated(forRemoval=true, since="1.21.5") int getId()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Raid identifiers are magic internal values and may or may not be present. -1 is returned for raids without an assigned id.
      Gets the id of this raid.
      Returns:
      the raid id
    • getBossBar

      BossBar getBossBar()
      Get the boss bar to be displayed for this raid.
      Returns:
      the boss bar