Class XPrisonPlayerEnchantEvent

java.lang.Object
org.bukkit.event.Event
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

    Constructors
    Constructor
    Description
    XPrisonPlayerEnchantEvent(org.bukkit.entity.Player player, long tokenCost, int level)
    Constructs a new XPrisonPlayerEnchantEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • XPrisonPlayerEnchantEvent

      public XPrisonPlayerEnchantEvent(org.bukkit.entity.Player player, long tokenCost, int level)
      Constructs a new XPrisonPlayerEnchantEvent.
      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 class org.bukkit.event.Event
      Returns:
      The static handler list.
    • isCancelled

      public boolean isCancelled()
      Checks whether this event is cancelled.
      Specified by:
      isCancelled in interface org.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 interface org.bukkit.event.Cancellable
      Parameters:
      cancel - true to cancel the event, false to allow it to proceed.