Package cn.nukkit.level
Class Explosion
java.lang.Object
cn.nukkit.level.Explosion
- Author:
- Angelic47 (Nukkit Project)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
explode()
Deprecated.boolean
explodeA()
Calculates which blocks will be destroyed by this explosion.boolean
explodeB()
Executes the explosion's effects on the world.double
boolean
void
setFireChance
(double fireChance) void
setIncendiary
(boolean incendiary)
-
Constructor Details
-
Explosion
-
Explosion
-
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 positionsize
- the power of explosionwhat
- the source object, used for tracking damage
-
-
Method Details
-
getFireChance
-
setFireChance
-
isIncendiary
-
setIncendiary
-
explode
public boolean explode()Deprecated.- Returns:
- bool
-
explodeA
public boolean explodeA()Calculates which blocks will be destroyed by this explosion. IfexplodeB()
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, otherwisetrue
-