Class XPrisonPlayerEnchantEvent
java.lang.Object
org.bukkit.event.Event
dev.drawethree.xprison.api.shared.events.XPrisonEvent
dev.drawethree.xprison.api.shared.events.player.XPrisonPlayerEvent
dev.drawethree.xprison.api.enchants.events.XPrisonPlayerEnchantEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public final class XPrisonPlayerEnchantEvent
extends XPrisonPlayerEvent
implements org.bukkit.event.Cancellable
Event called when a player enchants a pickaxe.
This event contains details about the player, the token cost of the enchantment, and the level of the enchant applied.
The event is cancellable, allowing listeners to prevent the enchantment from proceeding.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Field Summary
Fields inherited from class dev.drawethree.xprison.api.shared.events.player.XPrisonPlayerEvent
player
-
Constructor Summary
ConstructorsConstructorDescriptionXPrisonPlayerEnchantEvent
(org.bukkit.entity.Player player, long tokenCost, int level) Constructs a newXPrisonPlayerEnchantEvent
. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.event.HandlerList
Gets the handler list for this event.org.bukkit.event.HandlerList
Gets the handler list for this event instance.boolean
Checks whether this event is cancelled.void
setCancelled
(boolean cancel) Sets the cancellation state of this event.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
XPrisonPlayerEnchantEvent
public XPrisonPlayerEnchantEvent(org.bukkit.entity.Player player, long tokenCost, int level) Constructs a newXPrisonPlayerEnchantEvent
.- Parameters:
player
- The player enchanting the pickaxe.tokenCost
- The cost of the enchantment in tokens.level
- The level of the enchantment.
-
-
Method Details
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()Gets the handler list for this event.- Returns:
- The static handler list.
-
getHandlers
public org.bukkit.event.HandlerList getHandlers()Gets the handler list for this event instance.- Specified by:
getHandlers
in classorg.bukkit.event.Event
- Returns:
- The static handler list.
-
isCancelled
public boolean isCancelled()Checks whether this event is cancelled.- Specified by:
isCancelled
in interfaceorg.bukkit.event.Cancellable
- Returns:
true
if the event is cancelled,false
otherwise.
-
setCancelled
public void setCancelled(boolean cancel) Sets the cancellation state of this event.- Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
- Parameters:
cancel
-true
to cancel the event,false
to allow it to proceed.
-