Class SpectatorStartEvent
java.lang.Object
org.bukkit.event.Event
dev.itsharshxd.zentrix.api.events.ZentrixEvent
dev.itsharshxd.zentrix.api.events.spectator.SpectatorStartEvent
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
ConstructorsConstructorDescriptionSpectatorStartEvent(@NotNull org.bukkit.entity.Player player, @Nullable ZentrixGame game, boolean eliminated) -
Method Summary
Modifier and TypeMethodDescription@NotNull Optional<ZentrixGame> getGame()The match they are watching, when they are inside one.static @NotNull org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the handler list for this event.@NotNull org.bukkit.entity.PlayerThe new spectator.booleanWhether 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
-
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
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:ZentrixEventGets the handler list for this event.- Overrides:
getHandlersin classZentrixEvent- Returns:
- The handler list
-
getHandlerList
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()
-