Class 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
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 TypeFieldDescriptionprivate 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 ofHandlerList
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 Addonprivate 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
ConstructorsConstructorDescriptionGraveEvent
(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 newGraveEvent
. -
Method Summary
Modifier and TypeMethodDescription@Nullable 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.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.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.@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
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
(org.bukkit.Location location) Sets the location of the event.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Field Details
-
HANDLERS
private static final org.bukkit.event.HandlerList HANDLERSA static final instance ofHandlerList
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
The grave associated with the event.This
Grave
represents the specific grave entity involved in the event. -
entity
private final org.bukkit.entity.Entity entityThe entity associated with the event.This
Entity
represents the entity that is involved in the event. -
location
private 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. -
inventoryView
private final org.bukkit.inventory.InventoryView inventoryViewThe 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 livingEntityThe 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 targetEntityThe target living entity of the event.This
LivingEntity
represents the living entity that is the target or affected by the event. -
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 blockThe block associated with the event.This
Block
represents the specific block involved in the event. -
player
private final org.bukkit.entity.Player playerThe player associated with the event.This
Player
represents the player involved in or affected by the event. -
isCancelled
private boolean isCancelledIndicates whether the event has been cancelled.This
boolean
flag is used to determine if the event should be cancelled or not. -
dropItems
private boolean dropItemsIndicates 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 isAddonIndicates whether the event is an AddonThis
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 newGraveEvent
.- 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
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.
-
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
Gets the entity name in the event.- Returns:
- The entity name involved in the event, or null if not found.
-
getEntityCustomName
Gets the entity custom name in the event.- Returns:
- The entity custom name involved in the event, or null if not found.
-
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
Gets the living entity victim associated with the event.- Returns:
- The living entity victim, or null if not applicable.
-
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
Gets the living entity killers name associated with the event.- Returns:
- The living entity killers name, or null if not applicable.
-
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
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
Gets the player name involved in the event.- Returns:
- The player name involved in the event, or null if not applicable.
-
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
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 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.
-