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.BlockThe block associated with the event.final BlockData.BlockTypeThe type of block data associated with the event.final GraveThe grave associated with the event.@Nullable org.bukkit.LocationThe location related to the event. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGraveEvent(@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.BlockgetBlock()Gets the block involved in the event.intGets the experience points associated with the grave.Gets the type of block involved in the event.getGrave()Gets the grave associated with the event.intGets 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.HandlerListGets the static list of handlers for this event.@NotNull org.bukkit.event.HandlerListGets the list of handlers for this event.@NotNull org.bukkit.LocationGets the location of the event.booleanhasBlock()Checks the block involved in the event.booleanChecks the type of block involved in the event.booleanChecks if there is a location.booleanisAddon()Checks if the event is an addon hook.booleanChecks whether the event is cancelled.booleanChecks whether items should drop upon breaking the grave block.voidsetAddon(boolean addon) Sets the addon status for the current event.voidsetBlockExp(int experience) Sets the experience points associated with the grave.voidsetCancelled(boolean cancel) Sets whether the event is cancelled.voidsetDropItems(boolean dropItems) Sets whether items should drop upon breaking the grave block.voidsetLocation(@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
Graverepresents the specific grave entity involved in the event. -
location
@Nullable public @Nullable org.bukkit.Location locationThe location related to the event.This
Locationrepresents 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.BlockTyperepresents 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
Blockrepresents 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:
isCancelledin 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:
setCancelledin 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:
getHandlersin 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.
-