Class GraveZombieSpawnEvent

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

public class GraveZombieSpawnEvent extends GraveEvent
Represents an event that occurs when a zombie spawns at a grave.

This event extends GraveEvent and provides details about the location of the spawn and the entity that the zombie is targeting.

  • 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.

    • targetEntity

      @NotNull private final @NotNull org.bukkit.entity.LivingEntity targetEntity
      The entity that the zombie is targeting.
  • Constructor Details

    • GraveZombieSpawnEvent

      public GraveZombieSpawnEvent(@NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull org.bukkit.entity.LivingEntity targetEntity, @NotNull @NotNull Grave grave)
      Constructs a new GraveZombieSpawnEvent.
      Parameters:
      location - The location where the zombie is spawning.
      targetEntity - The entity that the zombie is targeting.
      grave - The grave associated with the event.
  • Method Details

    • getTargetEntity

      @NotNull public @NotNull org.bukkit.entity.LivingEntity getTargetEntity()
      Gets the Target Entity
      Returns:
      the targeted living entity.
    • getTargetEntityType

      @NotNull public @NotNull org.bukkit.entity.EntityType getTargetEntityType()
      Gets the Target Entity Type
      Returns:
      the type of the targeted entity.
    • hasPlayerTarget

      public boolean hasPlayerTarget()
      Returns whether the target is a Player.
      Returns:
      true if the target is a player; otherwise false.
    • getTargetPlayer

      @NotNull public @NotNull org.bukkit.entity.Player getTargetPlayer()
      Returns the targeted Player.
      Returns:
      the player being targeted.
      Throws:
      GravesXEventNullPointerException - if the target is not a player.
    • getTargetPlayerName

      @NotNull public @NotNull String getTargetPlayerName()
      Returns the targeted player's name.
      Returns:
      the player's current name.
      Throws:
      GravesXEventNullPointerException - if the target is not a player.
    • getTargetPlayerUniqueId

      @NotNull public @NotNull UUID getTargetPlayerUniqueId()
      Returns the targeted player's UUID.
      Returns:
      the player's unique identifier.
      Throws:
      GravesXEventNullPointerException - if the target is not a player.
    • 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.