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.BlockThe block associated with the event.private final BlockData.BlockTypeThe type of block data associated with the event.private booleanIndicates whether items should be dropped during the event.private final org.bukkit.entity.EntityThe entity associated with the event.private final GraveThe grave associated with the event.private static final org.bukkit.event.HandlerListA static final instance ofHandlerListused to manage event handlers.private final org.bukkit.inventory.InventoryViewThe inventory view associated with the event.private booleanIndicates whether the event is an Addonprivate booleanIndicates whether the event has been cancelled.private final org.bukkit.entity.LivingEntityThe living entity involved in the event.private org.bukkit.LocationThe location related to the event.private final org.bukkit.entity.PlayerThe player associated with the event.private final org.bukkit.entity.LivingEntityThe 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.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.org.bukkit.entity.EntityGets the entity involved in the event.Gets the entity custom name in the event.Gets the entity name in the event.org.bukkit.entity.EntityTypeGets the type of the target entity.@Nullable UUIDGets the entity unique ID 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.@Nullable org.bukkit.inventory.InventoryViewGets the inventory view associated with the event.@Nullable org.bukkit.entity.LivingEntityGets the living entity associated with the event.@Nullable org.bukkit.entity.LivingEntityGets the living entity killer associated with the event.@Nullable StringGets the living entity killers name associated with the event.@Nullable org.bukkit.entity.EntityTypeGets the living entity killer type associated with the event.@Nullable UUIDGets the living entity killers unique ID associated with the event.@Nullable StringGets the living entity victim associated with the event.@Nullable UUIDGets the living entity victim uuid associated with the event.@Nullable org.bukkit.entity.EntityTypeGets the living entity victim type associated with the event.org.bukkit.LocationGets the location of the event.@Nullable org.bukkit.entity.PlayerGets the player involved in the event.@Nullable StringGets the player display name involved in the event.@Nullable StringGets the player name involved in the event.@Nullable UUIDGets the player unique ID involved in the event.org.bukkit.entity.LivingEntityGets the entity targeted by the event.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(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 ofHandlerListused to manage event handlers.This
HandlerListis 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
Graverepresents the specific grave entity involved in the event. -
entity
private final org.bukkit.entity.Entity entityThe entity associated with the event.This
Entityrepresents the entity that is involved in the event. -
location
private 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. -
inventoryView
private final org.bukkit.inventory.InventoryView inventoryViewThe inventory view associated with the event.This
InventoryViewrepresents 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
LivingEntityrepresents the living entity that is part of the event. -
targetEntity
private final org.bukkit.entity.LivingEntity targetEntityThe target living entity of the event.This
LivingEntityrepresents the living entity that is the target or affected by the event. -
blockType
The type of block data associated with the event.This
BlockData.BlockTyperepresents the type of block data relevant to the event. -
block
private final org.bukkit.block.Block blockThe block associated with the event.This
Blockrepresents the specific block involved in the event. -
player
private final org.bukkit.entity.Player playerThe player associated with the event.This
Playerrepresents the player involved in or affected by the event. -
isCancelled
private boolean isCancelledIndicates whether the event has been cancelled.This
booleanflag 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
booleanflag determines if items should be dropped as a result of the event. -
isAddon
private boolean isAddonIndicates whether the event is an AddonThis
booleanflag 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:
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.
-