Class GravePreExplodeEvent

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

public class GravePreExplodeEvent extends GraveEvent
  • Constructor Details

    • GravePreExplodeEvent

      public GravePreExplodeEvent(@NotNull @NotNull Grave grave, @NotNull @NotNull org.bukkit.Location explosionLocation, @Nullable @Nullable org.bukkit.entity.Entity source, float radius)
      Constructs a new GravePreExplosionEvent.
      Parameters:
      grave - The grave that will be affected by the explosion.
      explosionLocation - The location where the explosion is primed to occur.
      source - The entity causing the explosion, may be null.
      radius - The radius of the primed explosion.
  • Method Details

    • getSource

      @Nullable public @Nullable org.bukkit.entity.Entity getSource()
      The entity that is causing the explosion (TNT, Creeper, etc.), or null.
    • setSource

      public void setSource(@Nullable @Nullable org.bukkit.entity.Entity source)
      Sets the entity that is causing the explosion (TNT, Creeper, etc.), or null.
      Parameters:
      source - The new source entity, or null.
    • getSourceType

      @Nullable public @Nullable org.bukkit.entity.EntityType getSourceType()
      The type of the source entity causing the explosion, or null if there is no source.
    • getExplosionLocation

      @NotNull public @NotNull org.bukkit.Location getExplosionLocation()
      Convenience alias for readability – the explosion center.
    • setExplosionLocation

      public void setExplosionLocation(@NotNull @NotNull org.bukkit.Location location)
      Sets the explosion center location.
      Parameters:
      location - The new explosion location.
    • getRadius

      public float getRadius()
      The radius of the primed explosion.
    • setRadius

      public void setRadius(float radius)
      Sets the radius of the primed explosion.
      Parameters:
      radius - The new radius.
    • hasWorld

      public boolean hasWorld()
      Checks whether the explosion location has an associated world.
      Returns:
      true if the world is not null, false otherwise.
    • getWorld

      @NotNull public @NotNull org.bukkit.World getWorld()
      Gets the world of the explosion location.
      Returns:
      The world of the explosion.
      Throws:
      GravesXNullPointerException - if the world is null.
    • getWorldNullable

      @Nullable public @Nullable org.bukkit.World getWorldNullable()
      Gets the world of the explosion location, or null if not set.
      Returns:
      The world of the explosion, or null.
    • setWorld

      public void setWorld(@NotNull @NotNull org.bukkit.World world)
      Sets the world of the explosion location while keeping its coordinates.
      Parameters:
      world - The new world.