Interface Spectator


public interface Spectator
Represents a spectating player and contains the info about him
  • Method Details

    • getPlayer

      Player getPlayer()
      Returns the player behind this data.
      Returns:
      Bukkit's player
    • getArena

      Arena getArena()
      Returns the arena which the player is spectating.
      Returns:
      The arena he's spectating
    • getReason

      SpectateReason getReason()
      Returns the reason or the cause of him being a spectator.
      Returns:
      The reason he's spectating
    • getEnterTime

      Instant getEnterTime()
      Returns the time when he got a spectator.
      Returns:
      The time he started to spectate
    • getReleaseTime

      @Nullable @Nullable Instant getReleaseTime()
      Returns the time when he is supposed to be released from enforced spectating.

      This is used for death spectating (getReason() equals SpectateReason.DEATH).

      Returns:
      The time he's supposed to be released. null if he's not supposed to be released automatically
    • isPresent

      boolean isPresent()
      Returns if this Spectator instance is still present.

      This method will always return false after he stopped being a spectator.

      Returns:
      true if he hasn't stopped being a spectator yet
    • kick

      default boolean kick()
      Same as kick(KickSpectatorReason). Only uses KickSpectatorReason.PLUGIN as the reason.
      Returns:
      true if it was successful
    • kick

      boolean kick(KickSpectatorReason reason)
      Stops the player from spectating any further.

      Additional things might happen depending on the reason given.

      Parameters:
      reason - Reason why he shall get kicked
      Returns:
      true if it was successful