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
FieldsModifier and TypeFieldDescriptionfinal @Nullable org.bukkit.block.Block
The block associated with the event.final BlockData.BlockType
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
ConstructorsModifierConstructorDescriptionprotected
GraveEvent
(@NotNull Grave grave, @Nullable org.bukkit.Location location, BlockData.BlockType blockType, @Nullable org.bukkit.block.Block block) Constructs a newGraveEvent
. -
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.block.Block
getBlock()
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.getGrave()
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
hasBlock()
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
isAddon()
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
-
Field Details
-
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 locationThe location related to the event.This
Location
represents the position in the world where the event is taking place or is relevant. -
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 blockThe 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 newGraveEvent
.- 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
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
Gets the grave UUID associated with the event.- Returns:
- The grave UUID associated with the event.
-
getGraveOwnerDisplayName
Gets the grave owner display name associated with the event.- Returns:
- The grave owner display name associated with the event.
-
getGraveOwnerName
Gets the grave owner name associated with the event.- Returns:
- The grave owner name associated with the event.
-
getGraveOwnerUniqueId
Gets the grave owner unique ID associated with the event.- Returns:
- The grave owner unique ID associated with the event.
-
getGraveOwnerNameDisplay
Gets the grave owner name display associated with the event.- Returns:
- The grave owner name display associated with the event.
-
getGraveOwnerTexture
Gets the grave owner texture associated with the event.- Returns:
- The grave owner texture display associated with the event.
-
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
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 interfaceorg.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 interfaceorg.bukkit.event.Cancellable
- Parameters:
cancel
- True to cancel the event, false otherwise.
-
isAddon
public boolean isAddon()Checks if the event is an addon hook. -
setAddon
public void setAddon(boolean addon) Sets the addon status for the current event. -
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Gets the list of handlers for this event.- Specified by:
getHandlers
in classorg.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.
-