Class EntityZapEvent

All Implemented Interfaces:
Cancellable
Direct Known Subclasses:
PigZapEvent

@NullMarked public class EntityZapEvent extends EntityTransformEvent implements Cancellable
Fired when lightning strikes an entity
  • Constructor Details

  • Method Details

    • getBolt

      public LightningStrike getBolt()
      Gets the lightning bolt that is striking the entity.
      Returns:
      The lightning bolt responsible for this event
    • getReplacementEntity

      public Entity getReplacementEntity()
      Gets the entity that will replace the struck entity.
      Returns:
      The entity that will replace the struck entity
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: Cancellable
      Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins
      Specified by:
      isCancelled in interface Cancellable
      Overrides:
      isCancelled in class EntityTransformEvent
      Returns:
      true if this event is cancelled
    • setCancelled

      public void setCancelled(boolean cancel)
      Description copied from interface: Cancellable
      Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
      Specified by:
      setCancelled in interface Cancellable
      Overrides:
      setCancelled in class EntityTransformEvent
      Parameters:
      cancel - true if you wish to cancel this event
    • getHandlers

      public HandlerList getHandlers()
      Overrides:
      getHandlers in class EntityTransformEvent
    • getHandlerList

      public static HandlerList getHandlerList()