Class GraveEvent

java.lang.Object
org.bukkit.event.Event
com.ranull.graves.event.GraveEvent
All Implemented Interfaces:
Addon, org.bukkit.event.Cancellable
Direct Known Subclasses:
GraveAbandonedEvent, GraveAutoLootEvent, GraveBlockPlaceEvent, GraveBreakEvent, GraveCloseEvent, GraveCompassAddEvent, GraveCompassUseEvent, GraveCreateEvent, GraveEconomyEvent, GraveExplodeEvent, GraveLootedEvent, GraveObituaryAddEvent, GraveOpenEvent, GraveParticleEvent, GravePistonExtendEvent, GravePlayerHeadDropEvent, GraveProjectileHitEvent, GraveProtectionCreateEvent, GraveProtectionExpiredEvent, GraveTeleportEvent, GraveTimeoutEvent, GraveWalkOverEvent, 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
    private final org.bukkit.block.Block
    The block associated with the event.
    private final BlockData.BlockType
    The type of block data associated with the event.
    private boolean
    Indicates whether items should be dropped during the event.
    private final org.bukkit.entity.Entity
    The entity associated with the event.
    private final Grave
    The grave associated with the event.
    private static final org.bukkit.event.HandlerList
    A static final instance of HandlerList used to manage event handlers.
    private final org.bukkit.inventory.InventoryView
    The inventory view associated with the event.
    private boolean
    Indicates whether the event is an Addon
    private boolean
    Indicates whether the event has been cancelled.
    private final org.bukkit.entity.LivingEntity
    The living entity involved in the event.
    private org.bukkit.Location
    The location related to the event.
    private final org.bukkit.entity.Player
    The player associated with the event.
    private final org.bukkit.entity.LivingEntity
    The target living entity of the event.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GraveEvent(Grave grave, @Nullable org.bukkit.entity.Entity entity, @Nullable org.bukkit.Location location, @Nullable org.bukkit.inventory.InventoryView inventoryView, @Nullable org.bukkit.entity.LivingEntity livingEntity, BlockData.BlockType blockType, @Nullable org.bukkit.block.Block block, @Nullable org.bukkit.entity.LivingEntity targetEntity, @Nullable org.bukkit.entity.Player player)
    Constructs a new GraveEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable 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.
    org.bukkit.entity.Entity
    Gets the entity involved in the event.
    Gets the entity custom name in the event.
    Gets the entity name in the event.
    org.bukkit.entity.EntityType
    Gets the type of the target entity.
    @Nullable UUID
    Gets the entity unique ID 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.
    @Nullable org.bukkit.inventory.InventoryView
    Gets the inventory view associated with the event.
    @Nullable org.bukkit.entity.LivingEntity
    Gets the living entity associated with the event.
    @Nullable org.bukkit.entity.LivingEntity
    Gets the living entity killer associated with the event.
    @Nullable String
    Gets the living entity killers name associated with the event.
    @Nullable org.bukkit.entity.EntityType
    Gets the living entity killer type associated with the event.
    @Nullable UUID
    Gets the living entity killers unique ID associated with the event.
    @Nullable String
    Gets the living entity victim associated with the event.
    @Nullable UUID
    Gets the living entity victim uuid associated with the event.
    @Nullable org.bukkit.entity.EntityType
    Gets the living entity victim type associated with the event.
    org.bukkit.Location
    Gets the location of the event.
    @Nullable org.bukkit.entity.Player
    Gets the player involved in the event.
    @Nullable String
    Gets the player display name involved in the event.
    @Nullable String
    Gets the player name involved in the event.
    @Nullable UUID
    Gets the player unique ID involved in the event.
    org.bukkit.entity.LivingEntity
    Gets the entity targeted by the event.
    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(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

    • HANDLERS

      private static final org.bukkit.event.HandlerList HANDLERS
      A static final instance of HandlerList used to manage event handlers.

      This HandlerList is used to register and manage the handlers for events of this type. It provides the mechanism for adding, removing, and invoking event handlers.

    • grave

      private final Grave grave
      The grave associated with the event.

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

    • entity

      private final org.bukkit.entity.Entity entity
      The entity associated with the event.

      This Entity represents the entity that is involved in the event.

    • location

      private 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.

    • inventoryView

      private final org.bukkit.inventory.InventoryView inventoryView
      The inventory view associated with the event.

      This InventoryView represents the view of the inventory related to the event, such as a player's inventory or a chest.

    • livingEntity

      private final org.bukkit.entity.LivingEntity livingEntity
      The living entity involved in the event.

      This LivingEntity represents the living entity that is part of the event.

    • targetEntity

      private final org.bukkit.entity.LivingEntity targetEntity
      The target living entity of the event.

      This LivingEntity represents the living entity that is the target or affected by the event.

    • blockType

      private 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

      private final org.bukkit.block.Block block
      The block associated with the event.

      This Block represents the specific block involved in the event.

    • player

      private final org.bukkit.entity.Player player
      The player associated with the event.

      This Player represents the player involved in or affected by the event.

    • isCancelled

      private boolean isCancelled
      Indicates whether the event has been cancelled.

      This boolean flag is used to determine if the event should be cancelled or not.

    • dropItems

      private boolean dropItems
      Indicates whether items should be dropped during the event.

      This boolean flag determines if items should be dropped as a result of the event.

    • isAddon

      private boolean isAddon
      Indicates whether the event is an Addon

      This boolean flag is used to determine if the event should be an addon or not.

  • Constructor Details

    • GraveEvent

      public GraveEvent(Grave grave, @Nullable @Nullable org.bukkit.entity.Entity entity, @Nullable @Nullable org.bukkit.Location location, @Nullable @Nullable org.bukkit.inventory.InventoryView inventoryView, @Nullable @Nullable org.bukkit.entity.LivingEntity livingEntity, @Nullable BlockData.BlockType blockType, @Nullable @Nullable org.bukkit.block.Block block, @Nullable @Nullable org.bukkit.entity.LivingEntity targetEntity, @Nullable @Nullable org.bukkit.entity.Player player)
      Constructs a new GraveEvent.
      Parameters:
      grave - The grave associated with the event.
      entity - The entity involved in the event, if any.
      location - The location of the event.
      inventoryView - The inventory view associated with the event, if any.
      livingEntity - The living entity associated with the event, if any.
      blockType - The type of block involved in the event, if any.
      block - The block involved in the event, if any.
      targetEntity - The entity targeted by the event, if any.
      player - The player 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.
    • getEntity

      public org.bukkit.entity.Entity getEntity()
      Gets the entity involved in the event.
      Returns:
      The entity involved in the event, or null if not applicable.
    • getEntityName

      public String getEntityName()
      Gets the entity name in the event.
      Returns:
      The entity name involved in the event, or null if not found.
    • getEntityCustomName

      public String getEntityCustomName()
      Gets the entity custom name in the event.
      Returns:
      The entity custom name involved in the event, or null if not found.
    • getEntityUniqueId

      @Nullable public @Nullable UUID getEntityUniqueId()
      Gets the entity unique ID involved in the event.
      Returns:
      The entity unique ID involved in the event, or null if not applicable.
    • getTargetEntity

      public org.bukkit.entity.LivingEntity getTargetEntity()
      Gets the entity targeted by the event.
      Returns:
      The target entity, or null if not applicable.
    • getEntityType

      public org.bukkit.entity.EntityType getEntityType()
      Gets the type of the target entity.
      Returns:
      The type of the target entity, or null if not applicable.
    • getLocation

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

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

      @Nullable public @Nullable org.bukkit.inventory.InventoryView getInventoryView()
      Gets the inventory view associated with the event.
      Returns:
      The inventory view, or null if not applicable.
    • getLivingEntity

      @Nullable public @Nullable org.bukkit.entity.LivingEntity getLivingEntity()
      Gets the living entity associated with the event.
      Returns:
      The living entity, or null if not applicable.
    • getLivingEntityVictim

      @Nullable public @Nullable String getLivingEntityVictim()
      Gets the living entity victim associated with the event.
      Returns:
      The living entity victim, or null if not applicable.
    • getLivingEntityVictimId

      @Nullable public @Nullable UUID getLivingEntityVictimId()
      Gets the living entity victim uuid associated with the event.
      Returns:
      The living entity victim uuid, or null if not applicable.
    • getLivingEntityKiller

      @Nullable public @Nullable org.bukkit.entity.LivingEntity getLivingEntityKiller()
      Gets the living entity killer associated with the event.
      Returns:
      The living entity killer, or null if not applicable.
    • getLivingEntityKillerName

      @Nullable public @Nullable String getLivingEntityKillerName()
      Gets the living entity killers name associated with the event.
      Returns:
      The living entity killers name, or null if not applicable.
    • getLivingEntityKillerUniqueId

      @Nullable public @Nullable UUID getLivingEntityKillerUniqueId()
      Gets the living entity killers unique ID associated with the event.
      Returns:
      The living entity killers unique ID, or null if not applicable.
    • getLivingEntityVictimType

      @Nullable public @Nullable org.bukkit.entity.EntityType getLivingEntityVictimType()
      Gets the living entity victim type associated with the event.
      Returns:
      The living entity victim type, or null if not applicable.
    • getLivingEntityKillerType

      @Nullable public @Nullable org.bukkit.entity.EntityType getLivingEntityKillerType()
      Gets the living entity killer type associated with the event.
      Returns:
      The living entity killer type, or null if not applicable.
    • getBlockType

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

      @Nullable public @Nullable 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.
    • getPlayer

      @Nullable public @Nullable org.bukkit.entity.Player getPlayer()
      Gets the player involved in the event.
      Returns:
      The player involved in the event, or null if not applicable.
    • getPlayerName

      @Nullable public @Nullable String getPlayerName()
      Gets the player name involved in the event.
      Returns:
      The player name involved in the event, or null if not applicable.
    • getPlayerUniqueId

      @Nullable public @Nullable UUID getPlayerUniqueId()
      Gets the player unique ID involved in the event.
      Returns:
      The player unique ID involved in the event, or null if not applicable.
    • getPlayerDisplayName

      @Nullable public @Nullable String getPlayerDisplayName()
      Gets the player display name involved in the event.
      Returns:
      The player display name involved in the event, or null if not applicable.
    • 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.