Class GravePlayerHeadDropEvent

java.lang.Object
org.bukkit.event.Event
dev.cwhead.GravesX.event.graveevent.GraveEvent
dev.cwhead.GravesX.event.GravePlayerHeadDropEvent
All Implemented Interfaces:
Addon, org.bukkit.event.Cancellable
Direct Known Subclasses:
GravePlayerHeadDropEvent

public class GravePlayerHeadDropEvent extends GraveEvent
Represents an event that occurs when a Players Head is added to a grave.

This event extends GraveEvent and is cancellable, allowing event listeners to prevent Player Heads from being included in graves.

  • Field Details

    • HANDLERS

      private static final org.bukkit.event.HandlerList HANDLERS
      A static final instance of HandlerList 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.

    • entity

      @Nullable private final @Nullable org.bukkit.entity.Entity entity
      The entity for which the player head will be dropped (optional).
  • Constructor Details

    • GravePlayerHeadDropEvent

      public GravePlayerHeadDropEvent(@NotNull @NotNull Grave grave, @NotNull @NotNull org.bukkit.Location location, @Nullable @Nullable org.bukkit.entity.Entity entity)
      Constructs a new GravePlayerHeadDropEvent.
      Parameters:
      grave - The grave associated with the event.
      location - The location where the player head will be dropped.
      entity - The entity for which the player head will be dropped (nullable).
  • Method Details

    • hasEntity

      public boolean hasEntity()
      Checks of there is an entity present.
      Returns:
      true if an entity is present on this event.
    • getEntity

      @NotNull public @NotNull org.bukkit.entity.Entity getEntity()
      Gets the entity for which the player head will be dropped.
      Returns:
      The entity.
      Throws:
      GravesXEventNullPointerException - if no entity is present.
    • getHandlers

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