Class SpectatorStartEvent

java.lang.Object
org.bukkit.event.Event
dev.itsharshxd.zentrix.api.events.ZentrixEvent
dev.itsharshxd.zentrix.api.events.spectator.SpectatorStartEvent

public final class SpectatorStartEvent extends ZentrixEvent
Called after a player became a spectator: eliminated from their match, watching one through /spectate, or put back into spectating after a revival failed.

Zentrix has already isolated the player from gameplay and handed them the spectator tools when this fires, so listeners may add their own tools or presentation on top. Spectators stay invisible to gameplay whatever a listener does; this event is a notification.

Main thread; only fired while a listener is registered.

Since:
1.8.0
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpectatorStartEvent(@NotNull org.bukkit.entity.Player player, @Nullable ZentrixGame game, boolean eliminated)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    The match they are watching, when they are inside one.
    static @NotNull org.bukkit.event.HandlerList
     
    @NotNull org.bukkit.event.HandlerList
    Gets the handler list for this event.
    @NotNull org.bukkit.entity.Player
    The new spectator.
    boolean
    Whether they were eliminated from the match they watch, rather than having walked in to watch it.

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

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

    • SpectatorStartEvent

      public SpectatorStartEvent(@NotNull @NotNull org.bukkit.entity.Player player, @Nullable @Nullable ZentrixGame game, boolean eliminated)
  • Method Details

    • getPlayer

      @NotNull public @NotNull org.bukkit.entity.Player getPlayer()
      The new spectator.
    • getGame

      @NotNull public @NotNull Optional<ZentrixGame> getGame()
      The match they are watching, when they are inside one.
    • isEliminated

      public boolean isEliminated()
      Whether they were eliminated from the match they watch, rather than having walked in to watch it.
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Description copied from class: ZentrixEvent
      Gets the handler list for this event.
      Overrides:
      getHandlers in class ZentrixEvent
      Returns:
      The handler list
    • getHandlerList

      @NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()