Package de.marcely.bedwars.api.levelshop
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
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Field Summary
Fields inherited from class org.bukkit.event.player.PlayerEvent
player -
Constructor Summary
ConstructorsConstructorDescriptionPlayerPickupLevelItemEvent(PlayerPickupLevelItemEvent event, Player player) PlayerPickupLevelItemEvent(Player player, Arena arena, DropType dropType, Item item, int perItemLevelAmount) -
Method Summary
Modifier and TypeMethodDescriptionGet the spawner/drop type the player is about to pick up.static HandlerListgetItem()Get the item that the player is attempting to pick up.intGet the amount of levels the player is about to earn per item.voidsetPerItemLevelAmount(int levelAmount) Set the amount of levels the player is about to earn per item.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayerMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronousMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.marcely.bedwars.api.event.arena.ArenaEvent
getArenaMethods inherited from interface org.bukkit.event.Cancellable
isCancelled, setCancelled
-
Constructor Details
-
PlayerPickupLevelItemEvent
-
PlayerPickupLevelItemEvent
-
-
Method Details
-
getDropType
Get the spawner/drop type the player is about to pick up.- Returns:
- The drop type of the 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()ofgetItem().- 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()ofgetItem().- Parameters:
levelAmount- The amount of levels he picked up for each item- Throws:
IllegalArgumentException- levelAmount must be 0 or greater
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-