Class PlayerPickupLevelItemEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
de.marcely.bedwars.api.levelshop.PlayerPickupLevelItemEvent
All Implemented Interfaces:
ArenaEvent, Cancellable

public class PlayerPickupLevelItemEvent extends PlayerEvent implements ArenaEvent, Cancellable
Gets called when a player picks up a spawner item that earns the player level.

Cancelling this event results in the player not picking up the item and not earning levels at all.

  • Constructor Details

  • Method Details

    • getDropType

      public DropType getDropType()
      Get the spawner/drop type the player is about to pick up.
      Returns:
      The drop type of the item
    • getItem

      public Item getItem()
      Get the item that the player is attempting to pick up.
      Returns:
      The item the player attempts to pick up
    • getPerItemLevelAmount

      public int getPerItemLevelAmount()
      Get the amount of levels the player is about to earn per item.

      Total amount of levels he is going to earn is equal to this number multiplied with ItemStack.getAmount() of getItem().

      Returns:
      The amount of levels he picked up for each item
    • setPerItemLevelAmount

      public void setPerItemLevelAmount(int levelAmount)
      Set the amount of levels the player is about to earn per item.

      Total amount of levels he is going to earn is equal to this number multiplied with ItemStack.getAmount() of getItem().

      Parameters:
      levelAmount - The amount of levels he picked up for each item
      Throws:
      IllegalArgumentException - levelAmount must be 0 or greater
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()