Class GraveEvent

java.lang.Object
org.bukkit.event.Event
dev.cwhead.GravesX.event.graveevent.GraveEvent
All Implemented Interfaces:
Addon, org.bukkit.event.Cancellable
Direct Known Subclasses:
GraveAbandonedEvent, GraveBlockPlaceEvent, GraveEntityEvent, GraveExpiredEvent, GraveExplodeEvent, GraveObituaryAddEvent, GravePistonExtendEvent, GravePlayerHeadDropEvent, GraveProtectionExpiredEvent, GraveTimeoutEvent, GraveZombieSpawnEvent

public abstract class GraveEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable, Addon
The base class for all grave-related events.

This class provides common properties for grave events, such as the grave itself, the location of the event, the entity involved, and additional information like inventory views and blocks. This class is cancellable, allowing event listeners to prevent the event from proceeding.

  • Nested Class Summary

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

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

    Fields
    Modifier and Type
    Field
    Description
    final @Nullable org.bukkit.block.Block
    The block associated with the event.
    The type of block data associated with the event.
    final Grave
    The grave associated with the event.
    @Nullable org.bukkit.Location
    The location related to the event.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    GraveEvent(@NotNull Grave grave, @Nullable org.bukkit.Location location, BlockData.BlockType blockType, @Nullable org.bukkit.block.Block block)
    Constructs a new GraveEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull org.bukkit.block.Block
    Gets the block involved in the event.
    int
    Gets the experience points associated with the grave.
    Gets the type of block involved in the event.
    Gets the grave associated with the event.
    int
    Gets the grave experience associated with the event.
    Gets the grave owner display name associated with the event.
    Gets the grave owner name associated with the event.
    Gets the grave owner name display associated with the event.
    Gets the grave owner texture associated with the event.
    Gets the grave owner texture signature associated with the event.
    Gets the grave owner unique ID associated with the event.
    Gets the grave UUID associated with the event.
    static @NotNull org.bukkit.event.HandlerList
    Gets the static list of handlers for this event.
    @NotNull org.bukkit.event.HandlerList
    Gets the list of handlers for this event.
    @NotNull org.bukkit.Location
    Gets the location of the event.
    boolean
    Checks the block involved in the event.
    boolean
    Checks the type of block involved in the event.
    boolean
    Checks if there is a location.
    boolean
    Checks if the event is an addon hook.
    boolean
    Checks whether the event is cancelled.
    boolean
    Checks whether items should drop upon breaking the grave block.
    void
    setAddon(boolean addon)
    Sets the addon status for the current event.
    void
    setBlockExp(int experience)
    Sets the experience points associated with the grave.
    void
    setCancelled(boolean cancel)
    Sets whether the event is cancelled.
    void
    setDropItems(boolean dropItems)
    Sets whether items should drop upon breaking the grave block.
    void
    setLocation(@NotNull org.bukkit.Location location)
    Sets the location of the 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 Details

    • grave

      public final Grave grave
      The grave associated with the event.

      This Grave represents the specific grave entity involved in the event.

    • location

      @Nullable public @Nullable org.bukkit.Location location
      The location related to the event.

      This Location represents the position in the world where the event is taking place or is relevant.

    • blockType

      @Nullable public final BlockData.BlockType blockType
      The type of block data associated with the event.

      This BlockData.BlockType represents the type of block data relevant to the event.

    • block

      @Nullable public final @Nullable org.bukkit.block.Block block
      The block associated with the event.

      This Block represents the specific block involved in the event.

  • Constructor Details

    • GraveEvent

      protected GraveEvent(@NotNull @NotNull Grave grave, @Nullable @Nullable org.bukkit.Location location, @Nullable BlockData.BlockType blockType, @Nullable @Nullable org.bukkit.block.Block block)
      Constructs a new GraveEvent.
      Parameters:
      grave - The grave associated with the event.
      location - The location of the event.
      blockType - The type of block involved in the event, if any.
      block - The block involved in the event, if any.
  • Method Details

    • getGrave

      public Grave getGrave()
      Gets the grave associated with the event.
      Returns:
      The grave associated with the event.
    • getGraveExperience

      public int getGraveExperience()
      Gets the grave experience associated with the event.
      Returns:
      The grave experience associated with the event.
    • getGraveUUID

      public UUID getGraveUUID()
      Gets the grave UUID associated with the event.
      Returns:
      The grave UUID associated with the event.
    • getGraveOwnerDisplayName

      public String getGraveOwnerDisplayName()
      Gets the grave owner display name associated with the event.
      Returns:
      The grave owner display name associated with the event.
    • getGraveOwnerName

      public String getGraveOwnerName()
      Gets the grave owner name associated with the event.
      Returns:
      The grave owner name associated with the event.
    • getGraveOwnerUniqueId

      public UUID getGraveOwnerUniqueId()
      Gets the grave owner unique ID associated with the event.
      Returns:
      The grave owner unique ID associated with the event.
    • getGraveOwnerNameDisplay

      public String getGraveOwnerNameDisplay()
      Gets the grave owner name display associated with the event.
      Returns:
      The grave owner name display associated with the event.
    • getGraveOwnerTexture

      public String getGraveOwnerTexture()
      Gets the grave owner texture associated with the event.
      Returns:
      The grave owner texture display associated with the event.
    • getGraveOwnerTextureSignature

      public String getGraveOwnerTextureSignature()
      Gets the grave owner texture signature associated with the event.
      Returns:
      The grave owner texture signature associated with the event.
    • hasLocation

      public boolean hasLocation()
      Checks if there is a location.
      Returns:
      The location of the event.
    • getLocation

      @NotNull public @NotNull org.bukkit.Location getLocation()
      Gets the location of the event.
      Returns:
      The location of the event.
    • setLocation

      public void setLocation(@NotNull @NotNull org.bukkit.Location location)
      Sets the location of the event.
      Parameters:
      location - The new location of the event.
    • hasBlockType

      public boolean hasBlockType()
      Checks the type of block involved in the event.
      Returns:
      The block type, or null if not applicable.
    • getBlockType

      @NotNull public BlockData.BlockType getBlockType()
      Gets the type of block involved in the event.
      Returns:
      The block type, or null if not applicable.
    • hasBlock

      public boolean hasBlock()
      Checks the block involved in the event.
      Returns:
      The block involved in the event, or null if not applicable.
    • getBlock

      @NotNull public @NotNull org.bukkit.block.Block getBlock()
      Gets the block involved in the event.
      Returns:
      The block involved in the event, or null if not applicable.
    • getBlockExp

      public int getBlockExp()
      Gets the experience points associated with the grave.
      Returns:
      The experience points.
    • setBlockExp

      public void setBlockExp(int experience)
      Sets the experience points associated with the grave.
    • isDropItems

      public boolean isDropItems()
      Checks whether items should drop upon breaking the grave block.
      Returns:
      True if items should drop, false otherwise.
    • setDropItems

      public void setDropItems(boolean dropItems)
      Sets whether items should drop upon breaking the grave block.
      Parameters:
      dropItems - True if items should drop, false otherwise.
    • isCancelled

      public boolean isCancelled()
      Checks whether the 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 whether the event is cancelled.
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
      Parameters:
      cancel - True to cancel the event, false otherwise.
    • isAddon

      public boolean isAddon()
      Checks if the event is an addon hook.
      Specified by:
      isAddon in interface Addon
      Returns:
      true if this is an addon, false otherwise.
    • setAddon

      public void setAddon(boolean addon)
      Sets the addon status for the current event.
      Specified by:
      setAddon in interface Addon
      Parameters:
      addon - true to mark as an addon, false otherwise.
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Gets the list of handlers for this event.
      Specified by:
      getHandlers in class org.bukkit.event.Event
      Returns:
      The handler list for this event.
    • getHandlerList

      @NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()
      Gets the static list of handlers for this event.
      Returns:
      The static handler list for this event.