Class LayerTriggerEvent

All Implemented Interfaces:
org.bukkit.event.Cancellable

public final class LayerTriggerEvent extends XPrisonPlayerEnchantTriggerEvent implements org.bukkit.event.Cancellable
Event called when the Layer enchant is triggered.

This event contains information about the player who triggered the enchant, the WorldGuard region where it happened, the original block broken, and the list of blocks affected by the enchantment.

The event is cancellable, allowing listeners to prevent the enchant effect from occurring.

  • 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.enchants.events.XPrisonPlayerEnchantTriggerEvent

    blocksAffected, mineRegion, originBlock, player
  • Constructor Summary

    Constructors
    Constructor
    Description
    LayerTriggerEvent(org.bukkit.entity.Player p, org.codemc.worldguardwrapper.region.IWrappedRegion mineRegion, org.bukkit.block.Block originBlock, List<org.bukkit.block.Block> blocks)
    Constructs a new LayerTriggerEvent.
  • 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

    • LayerTriggerEvent

      public LayerTriggerEvent(org.bukkit.entity.Player p, org.codemc.worldguardwrapper.region.IWrappedRegion mineRegion, org.bukkit.block.Block originBlock, List<org.bukkit.block.Block> blocks)
      Constructs a new LayerTriggerEvent.
      Parameters:
      p - The player who triggered the enchant.
      mineRegion - The WorldGuard region where the enchant was triggered.
      originBlock - The original block broken that triggered the enchant.
      blocks - The list of affected blocks marked for removal.
  • 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
      Overrides:
      isCancelled in class XPrisonPlayerEnchantTriggerEvent
      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
      Overrides:
      setCancelled in class XPrisonPlayerEnchantTriggerEvent
      Parameters:
      cancel - true to cancel the event, false to allow it to proceed.