Class PlayerXpGainEvent
java.lang.Object
org.bukkit.event.Event
com.tomkeuper.bedwars.api.events.player.PlayerXpGainEvent
public class PlayerXpGainEvent
extends org.bukkit.event.Event
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Lets you know why did the player received new xp.Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerXpGainEvent
(org.bukkit.entity.Player player, int amount, PlayerXpGainEvent.XpSource xpSource) Called when a player receives new xp. -
Method Summary
Modifier and TypeMethodDescriptionint
Get the amount of xp received.static org.bukkit.event.HandlerList
@NotNull org.bukkit.event.HandlerList
org.bukkit.entity.Player
Get the player that have received new xp.Get xp sourceboolean
Check if event was cancelledvoid
setAmount
(int amount) Set the amount of xp received.void
setCancelled
(boolean cancelled) Cancel eventMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
PlayerXpGainEvent
public PlayerXpGainEvent(org.bukkit.entity.Player player, int amount, PlayerXpGainEvent.XpSource xpSource) Called when a player receives new xp. This only works when the internal Level System is used. Developers can "inject" their own level system.- Parameters:
player
- - target player.amount
- - amount of xp.xpSource
- - where did the player receive xp from.
-
-
Method Details
-
getPlayer
public org.bukkit.entity.Player getPlayer()Get the player that have received new xp. -
getAmount
public int getAmount()Get the amount of xp received. -
getXpSource
Get xp source -
isCancelled
public boolean isCancelled()Check if event was cancelled -
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlers
in classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList() -
setAmount
public void setAmount(int amount) Set the amount of xp received. -
setCancelled
public void setCancelled(boolean cancelled) Cancel event
-