Class GraveCreateEvent

All Implemented Interfaces:
Addon, org.bukkit.event.Cancellable
Direct Known Subclasses:
GraveCreateEvent

public class GraveCreateEvent extends GraveEntityEvent
Represents an event that occurs when a Grave is created for an entity or player.
  • Constructor Details

    • GraveCreateEvent

      public GraveCreateEvent(@NotNull @NotNull org.bukkit.entity.Entity entity, @NotNull @NotNull Grave grave)
      Constructs a new GraveCreateEvent without 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 new GraveCreateEvent with 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 be null or empty).
      ignoredItems - Items that were not stored in the grave (may be null or empty).
      ignoredBlocks - Blocks that were ignored for this grave (may be null or 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 be null or empty).
      ignoredBlocks - Blocks that were ignored for this grave (may be null or empty).
  • Method Details

    • getGrave

      @NotNull public @NotNull Grave getGrave()
      Gets the underlying Grave associated with this event.
      Overrides:
      getGrave in class GraveEvent
      Returns:
      the Grave associated with this event, never null.
    • getLocationDeath

      @Nullable public @Nullable org.bukkit.Location getLocationDeath()
      Gets the death location for this grave (local snapshot).
      Returns:
      the current death location, or null if 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, or null to 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 null if 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, or null to clear it.
    • getOwnerName

      @Nullable public @Nullable String getOwnerName()
      Gets the internal owner name (local snapshot).
      Returns:
      the owner name, or null if not set.
    • setOwnerName

      public void setOwnerName(@Nullable @Nullable String name)
      Sets the internal owner name (local snapshot).
      Parameters:
      name - the owner name, or null to clear it.
    • getOwnerNameDisplay

      @Nullable public @Nullable String getOwnerNameDisplay()
      Gets the display name for the grave owner (local snapshot).
      Returns:
      the owner display name, or null if not set.
    • setOwnerNameDisplay

      public void setOwnerNameDisplay(@Nullable @Nullable String displayName)
      Sets the display name for the grave owner (local snapshot).
      Parameters:
      displayName - the owner display name, or null to clear it.
    • getOwnerUUID

      @Nullable public @Nullable UUID getOwnerUUID()
      Gets the UUID of the grave owner (local snapshot).
      Returns:
      the owner UUID, or null if not set.
    • setOwnerUUID

      public void setOwnerUUID(@Nullable @Nullable UUID uuid)
      Sets the UUID of the grave owner (local snapshot).
      Parameters:
      uuid - the owner UUID, or null to clear it.
    • getPermissionList

      @NotNull public @NotNull List<String> 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

      public void setPermissionList(@Nullable @Nullable List<String> permissionList)
      Sets the permission list associated with this grave (local snapshot).
      Parameters:
      permissionList - the new permission list, or null to 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

      @Nullable public @Nullable String getOwnerTexture()
      Gets the owner texture (e.g., skin texture URL or base64 string), if any (local snapshot).
      Returns:
      the owner texture, or null if not set.
    • setOwnerTexture

      public void setOwnerTexture(@Nullable @Nullable String texture)
      Sets the owner texture (e.g., skin texture URL or base64 string) (local snapshot).
      Parameters:
      texture - the owner texture, or null to clear it.
    • getOwnerTextureSignature

      @Nullable public @Nullable String getOwnerTextureSignature()
      Gets the owner texture signature, if any (local snapshot).
      Returns:
      the owner texture signature, or null if not set.
    • setOwnerTextureSignature

      public void setOwnerTextureSignature(@Nullable @Nullable String signature)
      Sets the owner texture signature (local snapshot).
      Parameters:
      signature - the texture signature, or null to 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 null if 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, or null to clear it.
    • getKillerName

      @Nullable public @Nullable String getKillerName()
      Gets the internal killer name (local snapshot).
      Returns:
      the killer name, or null if not set.
    • setKillerName

      public void setKillerName(@Nullable @Nullable String name)
      Sets the internal killer name (local snapshot).
      Parameters:
      name - the killer name, or null to clear it.
    • getKillerNameDisplay

      @Nullable public @Nullable String getKillerNameDisplay()
      Gets the display name for the killer (local snapshot).
      Returns:
      the killer display name, or null if not set.
    • setKillerNameDisplay

      public void setKillerNameDisplay(@Nullable @Nullable String displayName)
      Sets the display name for the killer (local snapshot).
      Parameters:
      displayName - the killer display name, or null to clear it.
    • getKillerUUID

      @Nullable public @Nullable UUID getKillerUUID()
      Gets the UUID of the killer, if any (local snapshot).
      Returns:
      the killer UUID, or null if unknown or not set.
    • setKillerUUID

      public void setKillerUUID(@Nullable @Nullable UUID uuid)
      Sets the UUID of the killer (local snapshot).
      Parameters:
      uuid - the killer UUID, or null to clear it.
    • getProtection

      public boolean getProtection()
      Returns whether protection is enabled for this grave (local snapshot).
      Returns:
      true if protection is enabled; false otherwise.
    • setProtection

      public void setProtection(boolean enabled)
      Sets whether protection is enabled for this grave (local snapshot).
      Parameters:
      enabled - true to enable protection; false to 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

      @NotNull public @NotNull Collection<org.bukkit.inventory.ItemStack> 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 be null or empty).
    • getIgnoredItems

      @NotNull public @NotNull Collection<org.bukkit.inventory.ItemStack> 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 be null or 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, or null to 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 be null).
      Returns:
      true if the item was present and removed; false otherwise.
    • getIgnoredBlocks

      @NotNull public @NotNull Collection<org.bukkit.block.Block> 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

      public void setIgnoredBlocks(@Nullable @Nullable Collection<org.bukkit.block.Block> ignoredBlocks)
      Sets the blocks that were ignored for this grave (local snapshot).
      Parameters:
      ignoredBlocks - blocks that were ignored for this grave (may be null or 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, or null to 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 be null).
      Returns:
      true if the block was present and removed; false otherwise.
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Gets the list of handlers for this event instance.
      Overrides:
      getHandlers in class GraveEntityEvent
      Returns:
      the HandlerList for 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 HandlerList for GraveCreateEvent.