Promotion background
Easter Season IS HERE!
10% off limited time offer!
Ends in
00
H
00
M
00
S
limited time offer SAVE 10% NOW →
Packages com.phoenixplugins.phoenixcrates.api crate events
com.phoenixplugins.phoenixcrates.api.crate.events

Class CratePreOpenEvent

  • java.lang.Object
    • org.bukkit.event.Event
      • com.phoenixplugins.phoenixcrates.api.crate.events.CratePreOpenEvent
  • All Implemented Interfaces:
    org.bukkit.event.Cancellable


    public class CratePreOpenEvent
    extends org.bukkit.event.Event
    implements org.bukkit.event.Cancellable
    Represents an event that occurs before a crate is opened by a player. This event allows for cancellation, preventing the crate from being opened.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.bukkit.event.Event

        org.bukkit.event.Event.Result
    • Field Summary

      Modifier and Type Field and Description
      protected boolean cancelled
      Indicates whether the event has been cancelled.
      protected CrateInstance crate
      The crate instance associated with this event.
      protected org.bukkit.entity.Player player
      The player associated with this event.
    • Constructor Summary

      Constructor and Description
      CratePreOpenEvent(CrateInstance crate, org.bukkit.entity.Player player)
      Constructor for the CratePreOpenEvent.
    • Method Summary

      Modifier and Type Method and Description
      static org.bukkit.event.HandlerList getHandlerList()
      Retrieves the handler list for this event.
      org.bukkit.event.HandlerList getHandlers()
      Gets the list of handlers for this event.
      CrateType getType()
      Retrieves the type of crate being opened.
      boolean isCancelled()
      Gets the cancellation status of this event.
      void setCancelled(boolean cancelled)
      Sets the cancellation status 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
    • Field Detail

      • crate

        protected final CrateInstance crate
        The crate instance associated with this event.

        Represents the specific crate that is being opened or interacted with.

      • player

        protected final org.bukkit.entity.Player player
        The player associated with this event.

        Represents the player who is attempting to open the crate.

      • cancelled

        protected boolean cancelled
        Indicates whether the event has been cancelled.

        Can be set to true to prevent the crate opening from proceeding.

    • Constructor Detail

      • CratePreOpenEvent

        public CratePreOpenEvent(CrateInstance crate,
                                 org.bukkit.entity.Player player)
        Constructor for the CratePreOpenEvent. Initializes the event with the crate instance and the player who is attempting to open it.
        Parameters:
        crate - the crate being opened
        player - the player attempting to open the crate
    • Method Detail

      • getType

        public CrateType getType()
        Retrieves the type of crate being opened. This is derived from the crate instance.
        Returns:
        the CrateType associated with the crate
      • getHandlers

        public org.bukkit.event.HandlerList getHandlers()
        Gets the list of handlers for this event. This is used by the Bukkit event system to manage event listeners.
        Specified by:
        getHandlers in class org.bukkit.event.Event
        Returns:
        the list of event handlers
      • getHandlerList

        public static org.bukkit.event.HandlerList getHandlerList()
        Retrieves the handler list for this event. This is a static method to allow external access to the handler list.
        Returns:
        the HandlerList for this event
      • isCancelled

        public boolean isCancelled()
        Gets the cancellation status of this event. If the event is cancelled, the crate will not be opened.
        Specified by:
        isCancelled in interface org.bukkit.event.Cancellable
        Returns:
        true if the event is cancelled, false otherwise
      • setCancelled

        public void setCancelled(boolean cancelled)
        Sets the cancellation status of this event. If the event is cancelled, the crate opening process will be prevented.
        Specified by:
        setCancelled in interface org.bukkit.event.Cancellable
        Parameters:
        cancelled - true to cancel the event, false to allow the crate to open
Last updated about 3 hours ago
My Cart (0 items)

Oops... looks like the spiders padded through here

Add products to your cart and remove them from here Lets buy
This site uses cookies to personalize content, enhance your experience. By continuing, you agree to our cookie use. Learn more