Interface MobExplodeEvent

All Superinterfaces:
Cancellable, Event, MobEvent

public interface MobExplodeEvent extends MobEvent, Cancellable
Fired when a mob is about to explode, as a creeper does at the end of its fuse.

Cancelling it keeps the mob alive: a creeper shrinks back, and whatever lit it goes out.

Since:
0.1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if the explosion breaks blocks.
    float
    Returns the power of the explosion.
    void
    setBreaksBlocks(boolean breaksBlocks)
    Lets the explosion break blocks, or keeps it from doing so.
    void
    setPower(float power)
    Changes the power of the explosion.

    Methods inherited from interface Cancellable

    isCancelled, setCancelled

    Methods inherited from interface MobEvent

    mob
  • Method Details

    • power

      float power()
      Returns the power of the explosion.: 3 for a creeper, twice that for a charged one
      Returns:
      the power of the explosion
      Since:
      0.1.0
    • setPower

      void setPower(float power)
      Changes the power of the explosion.
      Parameters:
      power - the new power; at 0 or less the mob vanishes without hurting or breaking anything
      Since:
      0.1.0
    • breaksBlocks

      boolean breaksBlocks()
      Returns true if the explosion breaks blocks., as it does when the mob_griefing game rule allows it
      Returns:
      true if the explosion breaks blocks
      Since:
      0.1.0
    • setBreaksBlocks

      void setBreaksBlocks(boolean breaksBlocks)
      Lets the explosion break blocks, or keeps it from doing so.
      Parameters:
      breaksBlocks - true to let it
      Since:
      0.1.0