bukkit Creating Explosions


Example

To create an explosion, the following method signatures may be used:

boolean createExplosion(double x, double y, double z, float power);
boolean createExplosion(double x, double y, double z, float power, boolean setFire);
boolean createExplosion(double x, double y, double z, float power,
                        boolean setFire, boolean breakBlocks);
boolean createExplosion(Location loc, float power);
boolean createExplosion(Location loc, float power, boolean setFire);
  • x, y, z and loc represent the location where you want the explosion to happen.
  • power represents the power of your explosion, TnT power is 4F.
  • setFire represents the capability of the explosion to set blocks on fire
  • breakBlocks represents the capability of the explosion to destroy blocks around it.
  • all the methods return true if the explosion happenned, and return false if a plugin cancelled the explosion event.

Simulating a TnT explosion that break blocks and set fire at x=0, y=0 and z=0

createExplosion(0.0, 0.0, 0.0, 4F, true, true);