Package dev.cwhead.GravesX.event
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
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.
-
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
ConstructorsConstructorDescriptionGraveZombieSpawnEvent
(@NotNull org.bukkit.Location location, @NotNull org.bukkit.entity.LivingEntity targetEntity, @NotNull Grave grave) Constructs a newGraveZombieSpawnEvent
. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull org.bukkit.event.HandlerList
Gets the static list of handlers for this event.@NotNull org.bukkit.event.HandlerList
Gets the list of handlers for this event.@NotNull org.bukkit.entity.LivingEntity
Gets the Target Entity@NotNull org.bukkit.entity.EntityType
Gets the Target Entity Type@NotNull org.bukkit.entity.Player
Returns the targetedPlayer
.@NotNull String
Returns the targeted player's name.@NotNull UUID
Returns the targeted player's UUID.boolean
Returns whether the target is aPlayer
.Methods inherited from class dev.cwhead.GravesX.event.graveevent.GraveEvent
getBlock, getBlockExp, getBlockType, getGrave, getGraveExperience, getGraveOwnerDisplayName, getGraveOwnerName, getGraveOwnerNameDisplay, getGraveOwnerTexture, getGraveOwnerTextureSignature, getGraveOwnerUniqueId, getGraveUUID, getLocation, hasBlock, hasBlockType, hasLocation, isAddon, isCancelled, isDropItems, setAddon, setBlockExp, setCancelled, setDropItems, setLocation
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
GraveZombieSpawnEvent
public GraveZombieSpawnEvent(@NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull org.bukkit.entity.LivingEntity targetEntity, @NotNull @NotNull Grave grave) Constructs a newGraveZombieSpawnEvent
.- 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 aPlayer
.- Returns:
true
if the target is a player; otherwisefalse
.
-
getTargetPlayer
@NotNull public @NotNull org.bukkit.entity.Player getTargetPlayer()Returns the targetedPlayer
.- Returns:
- the player being targeted.
- Throws:
GravesXEventNullPointerException
- if the target is not a player.
-
getTargetPlayerName
Returns the targeted player's name.- Returns:
- the player's current name.
- Throws:
GravesXEventNullPointerException
- if the target is not a player.
-
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 classGraveEvent
- 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.
-