Class ClassKitGrantEvent

java.lang.Object
org.bukkit.event.Event
All Implemented Interfaces:
org.bukkit.event.Cancellable

public final class ClassKitGrantEvent extends ZentrixGameEvent implements org.bukkit.event.Cancellable
Called before a player is handed their class kit: at match start, and when a revival or RevivalService#restoreLoadout restores class items.

getItems() is the mutable list of copies about to be added to the player's inventory; listeners may add, remove or replace items. Initial ability effects - the Fisherman's Luck - follow unless setApplyEffects(boolean) turns them off. Cancelling hands out neither.

Main thread; only fired while a listener is registered.

Since:
1.8.0
  • Constructor Details

    • ClassKitGrantEvent

      public ClassKitGrantEvent(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String classType, @NotNull @NotNull ClassKitGrantEvent.Cause cause, @NotNull @NotNull List<org.bukkit.inventory.ItemStack> items)
  • Method Details

    • getPlayer

      @NotNull public @NotNull org.bukkit.entity.Player getPlayer()
      The player receiving the kit.
    • getClassType

      @NotNull public @NotNull String getClassType()
      Their class, as PlayerClass#getType() names it, such as WARRIOR.
    • getCause

      @NotNull public @NotNull ClassKitGrantEvent.Cause getCause()
      Why the kit is handed out.
    • getItems

      @NotNull public @NotNull List<org.bukkit.inventory.ItemStack> getItems()
      The items about to be added, in order; listeners may change the list.
    • isApplyEffects

      public boolean isApplyEffects()
      Whether the class's initial ability effects are applied with the kit.
    • setApplyEffects

      public void setApplyEffects(boolean applyEffects)
      Applies or skips the class's initial ability effects.
    • 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()