Class RevivalItemUseEvent

java.lang.Object
org.bukkit.event.Event
dev.itsharshxd.zentrix.api.events.ZentrixEvent
dev.itsharshxd.zentrix.api.events.ZentrixGameEvent
dev.itsharshxd.zentrix.api.events.revival.RevivalItemUseEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public final class RevivalItemUseEvent extends ZentrixGameEvent implements org.bukkit.event.Cancellable
Called when a living player uses the Revival Star from content/items.yml, after Zentrix checked that they may revive in this match and phase, and before the teammate picker opens.

Cancelling keeps the picker closed; the star is not consumed either way - only a completed revival spends it, see RevivalItemConsumeEvent. A listener that cancels can, for instance, open its own picker and call RevivalService#revive.

Main thread; only fired while a listener is registered.

Since:
1.8.0
  • Constructor Details

    • RevivalItemUseEvent

      public RevivalItemUseEvent(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull org.bukkit.entity.Player player)
  • Method Details

    • getPlayer

      @NotNull public @NotNull org.bukkit.entity.Player getPlayer()
      The player using the star.
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean cancelled)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • getHandlers

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

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