Package com.vk2gpz.autosell.event
Class PlayerExpGainEvent
java.lang.Object
org.bukkit.event.Event
com.vk2gpz.autosell.event.PlayerExpGainEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class PlayerExpGainEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
This event is called when a player gains XP from a block.
It is used to modify the amount of XP that is applied to the block.
This event is cancellable, and if cancelled, the XP will not be given.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerExpGainEvent
(org.bukkit.entity.Player player, int xp, org.bukkit.block.Block b) Constructor to create a PlayerExpGainEvent object. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.block.Block
getBlock()
Gets the block that the XP was issued from.static org.bukkit.event.HandlerList
Gets the handler list for this event.@NotNull org.bukkit.event.HandlerList
Gets the amount of XP that was applied.org.bukkit.entity.Player
Gets the player who gains the XP.int
getXp()
Gets the amount of XP that was applied.boolean
Gets whether the event is cancelled or not.void
setBlock
(org.bukkit.block.Block block) Sets the block that the XP was from.void
setCancelled
(boolean cancelled) Sets whether the event is cancelled or not.void
setXp
(int xp) Sets the amount of XP that was applied.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
PlayerExpGainEvent
public PlayerExpGainEvent(org.bukkit.entity.Player player, int xp, org.bukkit.block.Block b) Constructor to create a PlayerExpGainEvent object.- Parameters:
player
- The player who gains the XP.xp
- The amount of XP that was applied.b
- The block that the XP was from.
-
-
Method Details
-
getPlayer
public org.bukkit.entity.Player getPlayer()Gets the player who gains the XP.- Returns:
- The player who gains the XP.
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Gets the amount of XP that was applied.- Specified by:
getHandlers
in classorg.bukkit.event.Event
- Returns:
- The amount of XP that was applied.
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()Gets the handler list for this event.- Returns:
- The handler list for this event.
-
isCancelled
public boolean isCancelled()Gets whether the event is cancelled or not.- Specified by:
isCancelled
in interfaceorg.bukkit.event.Cancellable
- Returns:
- Whether the event is cancelled or not.
-
setCancelled
public void setCancelled(boolean cancelled) Sets whether the event is cancelled or not.- Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
- Parameters:
cancelled
- Whether the event is cancelled or not.
-
setXp
public void setXp(int xp) Sets the amount of XP that was applied.- Parameters:
xp
- The amount of XP that was applied.
-
getXp
public int getXp()Gets the amount of XP that was applied.- Returns:
- The amount of XP that was applied.
-
getBlock
public org.bukkit.block.Block getBlock()Gets the block that the XP was issued from.- Returns:
- The block that the XP was issued from.
-
setBlock
public void setBlock(org.bukkit.block.Block block) Sets the block that the XP was from.- Parameters:
block
- The block that the XP was from.
-