Class Explosion

java.lang.Object
cn.nukkit.level.Explosion

public class Explosion extends Object
Author:
Angelic47 (Nukkit Project)
  • Constructor Details

    • Explosion

      public Explosion(Position center, double size, Entity what)
    • Explosion

      @PowerNukkitOnly @Since("1.4.0.0-PN") public Explosion(Position center, double size, Block what)
    • Explosion

      @PowerNukkitOnly @Since("1.4.0.0-PN") protected Explosion(Position center, double size, Object what)
      Creates explosion at given position with given power.
      Parameters:
      center - center position
      size - the power of explosion
      what - the source object, used for tracking damage
  • Method Details

    • getFireChance

      @PowerNukkitOnly @Since("1.4.0.0-PN") public double getFireChance()
    • setFireChance

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void setFireChance(double fireChance)
    • isIncendiary

      @PowerNukkitOnly @Since("1.4.0.0-PN") public boolean isIncendiary()
    • setIncendiary

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void setIncendiary(boolean incendiary)
    • explode

      public boolean explode()
      Deprecated.
      Returns:
      bool
    • explodeA

      public boolean explodeA()
      Calculates which blocks will be destroyed by this explosion. If explodeB() is called without calling this, no blocks will be destroyed.
      Returns:
      true if success
    • explodeB

      @PowerNukkitDifference(info="Using new method to play sounds", since="1.4.0.0-PN") @PowerNukkitXDifference(info="Reduce explosion damage if entities behind blocks", since="1.20.10-r1") public boolean explodeB()
      Executes the explosion's effects on the world. This includes destroying blocks (if any), harming and knocking back entities, and creating sounds and particles.
      Returns:
      false if explosion was canceled, otherwise true