Package dev.cwhead.GravesX.event
Class GraveCreateEvent
java.lang.Object
org.bukkit.event.Event
dev.cwhead.GravesX.event.graveevent.GraveEvent
dev.cwhead.GravesX.event.graveevent.GraveEntityEvent
dev.cwhead.GravesX.event.GraveCreateEvent
- All Implemented Interfaces:
Addon,org.bukkit.event.Cancellable
- Direct Known Subclasses:
GraveCreateEvent
Represents an event that occurs when a
Grave is created for an entity or player.-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
Fields inherited from class dev.cwhead.GravesX.event.graveevent.GraveEvent
block, blockType, grave, location -
Constructor Summary
ConstructorsConstructorDescriptionGraveCreateEvent(@NotNull org.bukkit.entity.Entity entity, @NotNull Grave grave) Constructs a newGraveCreateEventwithout any ignored items/blocks information.GraveCreateEvent(@NotNull org.bukkit.entity.Entity entity, @NotNull Grave grave, @Nullable Collection<org.bukkit.inventory.ItemStack> ignoredItems, @Nullable Collection<org.bukkit.block.Block> ignoredBlocks) Backwards-compatible constructor omitting the grave items collection.GraveCreateEvent(@NotNull org.bukkit.entity.Entity entity, @NotNull Grave grave, @Nullable Collection<org.bukkit.inventory.ItemStack> graveItemStackList, @Nullable Collection<org.bukkit.inventory.ItemStack> ignoredItems, @Nullable Collection<org.bukkit.block.Block> ignoredBlocks) Constructs a newGraveCreateEventwith ignored items and blocks. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIgnoredBlock(@Nullable org.bukkit.block.Block block) Adds a single block to the ignored blocks list for this grave creation (local snapshot).voidaddIgnoredItem(@Nullable org.bukkit.inventory.ItemStack item) Adds a single item to the ignored items list for this grave creation (local snapshot).intGets the amount of experience stored in this grave (local snapshot).@NotNull GravegetGrave()Gets the underlyingGraveassociated with this event.@NotNull Collection<org.bukkit.inventory.ItemStack> Gets the items intended to be stored in the grave (local snapshot).static @NotNull org.bukkit.event.HandlerListGets the static list of handlers for this event type.@NotNull org.bukkit.event.HandlerListGets the list of handlers for this event instance.@NotNull Collection<org.bukkit.block.Block> Gets the blocks that were ignored when creating this grave (local snapshot).@NotNull Collection<org.bukkit.inventory.ItemStack> Gets the items that were ignored (not stored) when creating this grave (local snapshot).@Nullable StringGets the internal killer name (local snapshot).@Nullable StringGets the display name for the killer (local snapshot).@Nullable org.bukkit.entity.EntityTypeGets the type of the killer entity, if any (local snapshot).@Nullable UUIDGets the UUID of the killer, if any (local snapshot).@Nullable org.bukkit.LocationGets the death location for this grave (local snapshot).@Nullable StringGets the internal owner name (local snapshot).@Nullable StringGets the display name for the grave owner (local snapshot).@Nullable StringGets the owner texture (e.g., skin texture URL or base64 string), if any (local snapshot).@Nullable StringGets the owner texture signature, if any (local snapshot).@Nullable org.bukkit.entity.EntityTypeGets the type of the entity that owns this grave (local snapshot).@Nullable UUIDGets the UUID of the grave owner (local snapshot).Gets an unmodifiable view of the permission list associated with this grave (local snapshot).floatgetPitch()Gets the pitch (vertical rotation) of the grave owner at the time of death (local snapshot).booleanReturns whether protection is enabled for this grave (local snapshot).longGets the amount of time, in milliseconds, that the grave will remain before timing out (local snapshot).longGets the duration of protection in milliseconds (local snapshot).floatgetYaw()Gets the yaw (horizontal rotation) of the grave owner at the time of death (local snapshot).booleanremoveIgnoredBlock(@Nullable org.bukkit.block.Block block) Removes a single block from the ignored blocks list for this grave creation (local snapshot).booleanremoveIgnoredItem(@Nullable org.bukkit.inventory.ItemStack item) Removes a single item from the ignored items list for this grave creation (local snapshot).voidsetDeathLocation(@Nullable org.bukkit.Location location) Sets the death location for this grave (local snapshot).voidsetExperience(int experience) Sets the amount of experience stored in this grave (local snapshot).voidsetGraveItemStackList(@Nullable Collection<org.bukkit.inventory.ItemStack> graveItemStackList) Sets the items intended to be stored in the grave (local snapshot).voidsetIgnoredBlocks(@Nullable Collection<org.bukkit.block.Block> ignoredBlocks) Sets the blocks that were ignored for this grave (local snapshot).voidsetIgnoredItems(@Nullable Collection<org.bukkit.inventory.ItemStack> ignoredItems) Sets the items that were ignored (not stored) when creating this grave (local snapshot).voidsetKillerName(@Nullable String name) Sets the internal killer name (local snapshot).voidsetKillerNameDisplay(@Nullable String displayName) Sets the display name for the killer (local snapshot).voidsetKillerType(@Nullable org.bukkit.entity.EntityType type) Sets the type of the killer entity (local snapshot).voidsetKillerUUID(@Nullable UUID uuid) Sets the UUID of the killer (local snapshot).voidsetOwnerName(@Nullable String name) Sets the internal owner name (local snapshot).voidsetOwnerNameDisplay(@Nullable String displayName) Sets the display name for the grave owner (local snapshot).voidsetOwnerTexture(@Nullable String texture) Sets the owner texture (e.g., skin texture URL or base64 string) (local snapshot).voidsetOwnerTextureSignature(@Nullable String signature) Sets the owner texture signature (local snapshot).voidsetOwnerType(@Nullable org.bukkit.entity.EntityType type) Sets the type of the entity that owns this grave (local snapshot).voidsetOwnerUUID(@Nullable UUID uuid) Sets the UUID of the grave owner (local snapshot).voidsetPermissionList(@Nullable List<String> permissionList) Sets the permission list associated with this grave (local snapshot).voidsetPitch(float pitch) Sets the pitch (vertical rotation) of the grave owner at the time of death (local snapshot).voidsetProtection(boolean enabled) Sets whether protection is enabled for this grave (local snapshot).voidsetTimeAlive(long millis) Sets the amount of time, in milliseconds, that the grave will remain before timing out (local snapshot).voidsetTimeProtection(long millis) Sets the duration of protection in milliseconds (local snapshot).voidsetYaw(float yaw) Sets the yaw (horizontal rotation) of the grave owner at the time of death (local snapshot).Methods inherited from class dev.cwhead.GravesX.event.graveevent.GraveEntityEvent
getEntity, getEntityCustomName, getEntityName, getEntityType, getEntityUniqueId, getLivingEntity, getLivingEntityKiller, getLivingEntityKillerName, getLivingEntityKillerType, getLivingEntityKillerUniqueId, getLivingEntityVictim, getLivingEntityVictimId, getLivingEntityVictimType, getPlayer, getTargetEntity, hasKiller, hasLivingEntity, hasPlayer, isEntityActuallyPlayerMethods inherited from class dev.cwhead.GravesX.event.graveevent.GraveEvent
getBlock, getBlockExp, getBlockType, getGraveExperience, getGraveOwnerDisplayName, getGraveOwnerName, getGraveOwnerNameDisplay, getGraveOwnerTexture, getGraveOwnerTextureSignature, getGraveOwnerUniqueId, getGraveUUID, getLocation, hasBlock, hasBlockType, hasLocation, isAddon, isCancelled, isDropItems, setAddon, setBlockExp, setCancelled, setDropItems, setLocationMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
GraveCreateEvent
public GraveCreateEvent(@NotNull @NotNull org.bukkit.entity.Entity entity, @NotNull @NotNull Grave grave) Constructs a newGraveCreateEventwithout any ignored items/blocks information.- Parameters:
entity- The entity for which the grave is being created.grave- The grave being created.
-
GraveCreateEvent
public GraveCreateEvent(@NotNull @NotNull org.bukkit.entity.Entity entity, @NotNull @NotNull Grave grave, @Nullable @Nullable Collection<org.bukkit.inventory.ItemStack> graveItemStackList, @Nullable @Nullable Collection<org.bukkit.inventory.ItemStack> ignoredItems, @Nullable @Nullable Collection<org.bukkit.block.Block> ignoredBlocks) Constructs a newGraveCreateEventwith ignored items and blocks.- Parameters:
entity- The entity for which the grave is being created.grave- The grave being created.graveItemStackList- Items intended to be stored in the grave (may benullor empty).ignoredItems- Items that were not stored in the grave (may benullor empty).ignoredBlocks- Blocks that were ignored for this grave (may benullor empty).
-
GraveCreateEvent
public GraveCreateEvent(@NotNull @NotNull org.bukkit.entity.Entity entity, @NotNull @NotNull Grave grave, @Nullable @Nullable Collection<org.bukkit.inventory.ItemStack> ignoredItems, @Nullable @Nullable Collection<org.bukkit.block.Block> ignoredBlocks) Backwards-compatible constructor omitting the grave items collection.- Parameters:
entity- The entity for which the grave is being created.grave- The grave being created.ignoredItems- Items that were not stored in the grave (may benullor empty).ignoredBlocks- Blocks that were ignored for this grave (may benullor empty).
-
-
Method Details
-
getGrave
Gets the underlyingGraveassociated with this event.- Overrides:
getGravein classGraveEvent- Returns:
- the
Graveassociated with this event, nevernull.
-
getLocationDeath
@Nullable public @Nullable org.bukkit.Location getLocationDeath()Gets the death location for this grave (local snapshot).- Returns:
- the current death location, or
nullif not set.
-
setDeathLocation
public void setDeathLocation(@Nullable @Nullable org.bukkit.Location location) Sets the death location for this grave (local snapshot).The creator is responsible for applying this value back to the
Grave.- Parameters:
location- the new death location, ornullto clear it.
-
getOwnerType
@Nullable public @Nullable org.bukkit.entity.EntityType getOwnerType()Gets the type of the entity that owns this grave (local snapshot).- Returns:
- the owner entity type, or
nullif not set.
-
setOwnerType
public void setOwnerType(@Nullable @Nullable org.bukkit.entity.EntityType type) Sets the type of the entity that owns this grave (local snapshot).- Parameters:
type- the owner entity type, ornullto clear it.
-
getOwnerName
Gets the internal owner name (local snapshot).- Returns:
- the owner name, or
nullif not set.
-
setOwnerName
Sets the internal owner name (local snapshot).- Parameters:
name- the owner name, ornullto clear it.
-
getOwnerNameDisplay
Gets the display name for the grave owner (local snapshot).- Returns:
- the owner display name, or
nullif not set.
-
setOwnerNameDisplay
Sets the display name for the grave owner (local snapshot).- Parameters:
displayName- the owner display name, ornullto clear it.
-
getOwnerUUID
Gets the UUID of the grave owner (local snapshot).- Returns:
- the owner UUID, or
nullif not set.
-
setOwnerUUID
Sets the UUID of the grave owner (local snapshot).- Parameters:
uuid- the owner UUID, ornullto clear it.
-
getPermissionList
Gets an unmodifiable view of the permission list associated with this grave (local snapshot).- Returns:
- a non-
null, unmodifiable list of permission strings; empty if none.
-
setPermissionList
Sets the permission list associated with this grave (local snapshot).- Parameters:
permissionList- the new permission list, ornullto clear it.
-
getYaw
public float getYaw()Gets the yaw (horizontal rotation) of the grave owner at the time of death (local snapshot).- Returns:
- the yaw value.
-
setYaw
public void setYaw(float yaw) Sets the yaw (horizontal rotation) of the grave owner at the time of death (local snapshot).- Parameters:
yaw- the new yaw value.
-
getPitch
public float getPitch()Gets the pitch (vertical rotation) of the grave owner at the time of death (local snapshot).- Returns:
- the pitch value.
-
setPitch
public void setPitch(float pitch) Sets the pitch (vertical rotation) of the grave owner at the time of death (local snapshot).- Parameters:
pitch- the new pitch value.
-
getTimeAlive
public long getTimeAlive()Gets the amount of time, in milliseconds, that the grave will remain before timing out (local snapshot).- Returns:
- the time-to-live in milliseconds.
-
setTimeAlive
public void setTimeAlive(long millis) Sets the amount of time, in milliseconds, that the grave will remain before timing out (local snapshot).- Parameters:
millis- the time-to-live in milliseconds.
-
getOwnerTexture
Gets the owner texture (e.g., skin texture URL or base64 string), if any (local snapshot).- Returns:
- the owner texture, or
nullif not set.
-
setOwnerTexture
Sets the owner texture (e.g., skin texture URL or base64 string) (local snapshot).- Parameters:
texture- the owner texture, ornullto clear it.
-
getOwnerTextureSignature
Gets the owner texture signature, if any (local snapshot).- Returns:
- the owner texture signature, or
nullif not set.
-
setOwnerTextureSignature
Sets the owner texture signature (local snapshot).- Parameters:
signature- the texture signature, ornullto clear it.
-
getExperience
public int getExperience()Gets the amount of experience stored in this grave (local snapshot).- Returns:
- the stored experience amount.
-
setExperience
public void setExperience(int experience) Sets the amount of experience stored in this grave (local snapshot).- Parameters:
experience- the experience amount to store.
-
getKillerType
@Nullable public @Nullable org.bukkit.entity.EntityType getKillerType()Gets the type of the killer entity, if any (local snapshot).- Returns:
- the killer entity type, or
nullif unknown or not set.
-
setKillerType
public void setKillerType(@Nullable @Nullable org.bukkit.entity.EntityType type) Sets the type of the killer entity (local snapshot).- Parameters:
type- the killer entity type, ornullto clear it.
-
getKillerName
Gets the internal killer name (local snapshot).- Returns:
- the killer name, or
nullif not set.
-
setKillerName
Sets the internal killer name (local snapshot).- Parameters:
name- the killer name, ornullto clear it.
-
getKillerNameDisplay
Gets the display name for the killer (local snapshot).- Returns:
- the killer display name, or
nullif not set.
-
setKillerNameDisplay
Sets the display name for the killer (local snapshot).- Parameters:
displayName- the killer display name, ornullto clear it.
-
getKillerUUID
Gets the UUID of the killer, if any (local snapshot).- Returns:
- the killer UUID, or
nullif unknown or not set.
-
setKillerUUID
Sets the UUID of the killer (local snapshot).- Parameters:
uuid- the killer UUID, ornullto clear it.
-
getProtection
public boolean getProtection()Returns whether protection is enabled for this grave (local snapshot).- Returns:
trueif protection is enabled;falseotherwise.
-
setProtection
public void setProtection(boolean enabled) Sets whether protection is enabled for this grave (local snapshot).- Parameters:
enabled-trueto enable protection;falseto disable it.
-
getTimeProtection
public long getTimeProtection()Gets the duration of protection in milliseconds (local snapshot).- Returns:
- the protection time in milliseconds.
-
setTimeProtection
public void setTimeProtection(long millis) Sets the duration of protection in milliseconds (local snapshot).- Parameters:
millis- the protection time in milliseconds.
-
getGraveItemStackList
Gets the items intended to be stored in the grave (local snapshot).- Returns:
- an unmodifiable collection of grave items, or an empty collection if none.
-
setGraveItemStackList
public void setGraveItemStackList(@Nullable @Nullable Collection<org.bukkit.inventory.ItemStack> graveItemStackList) Sets the items intended to be stored in the grave (local snapshot).- Parameters:
graveItemStackList- items intended to be stored in the grave (may benullor empty).
-
getIgnoredItems
Gets the items that were ignored (not stored) when creating this grave (local snapshot).- Returns:
- an unmodifiable collection of ignored items, or an empty collection if none.
-
setIgnoredItems
public void setIgnoredItems(@Nullable @Nullable Collection<org.bukkit.inventory.ItemStack> ignoredItems) Sets the items that were ignored (not stored) when creating this grave (local snapshot).- Parameters:
ignoredItems- items that were not stored in the grave (may benullor empty).
-
addIgnoredItem
public void addIgnoredItem(@Nullable @Nullable org.bukkit.inventory.ItemStack item) Adds a single item to the ignored items list for this grave creation (local snapshot).- Parameters:
item- the item to add to the ignored items list, ornullto do nothing.
-
removeIgnoredItem
public boolean removeIgnoredItem(@Nullable @Nullable org.bukkit.inventory.ItemStack item) Removes a single item from the ignored items list for this grave creation (local snapshot).- Parameters:
item- the item to remove from the ignored items list (may benull).- Returns:
trueif the item was present and removed;falseotherwise.
-
getIgnoredBlocks
Gets the blocks that were ignored when creating this grave (local snapshot).- Returns:
- an unmodifiable collection of ignored blocks, or an empty collection if none.
-
setIgnoredBlocks
Sets the blocks that were ignored for this grave (local snapshot).- Parameters:
ignoredBlocks- blocks that were ignored for this grave (may benullor empty).
-
addIgnoredBlock
public void addIgnoredBlock(@Nullable @Nullable org.bukkit.block.Block block) Adds a single block to the ignored blocks list for this grave creation (local snapshot).- Parameters:
block- the block to add to the ignored blocks list, ornullto do nothing.
-
removeIgnoredBlock
public boolean removeIgnoredBlock(@Nullable @Nullable org.bukkit.block.Block block) Removes a single block from the ignored blocks list for this grave creation (local snapshot).- Parameters:
block- the block to remove from the ignored blocks list (may benull).- Returns:
trueif the block was present and removed;falseotherwise.
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Gets the list of handlers for this event instance.- Overrides:
getHandlersin classGraveEntityEvent- Returns:
- the
HandlerListfor this event.
-
getHandlerList
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()Gets the static list of handlers for this event type.- Returns:
- the static
HandlerListforGraveCreateEvent.
-