Additional configuration options for the Dimension.createExplosion method.

// Creates an explosion of radius 15 that does not break blocks
import { DimensionLocation } from '@minecraft/server';

function createExplosions(location: DimensionLocation) {
// Creates an explosion of radius 15 that does not break blocks
location.dimension.createExplosion(location, 15, { breaksBlocks: false });

// Creates an explosion of radius 15 that does not cause fire
location.dimension.createExplosion(location, 15, { causesFire: true });

// Creates an explosion of radius 10 that can go underwater
location.dimension.createExplosion(location, 10, { allowUnderwater: true });
}
interface ExplosionOptions {
    allowUnderwater?: boolean;
    breaksBlocks?: boolean;
    causesFire?: boolean;
    source?: Entity;
}

Properties

allowUnderwater?: boolean

Whether parts of the explosion also impact underwater.

breaksBlocks?: boolean

Whether the explosion will break blocks within the blast radius.

causesFire?: boolean

If true, the explosion is accompanied by fires within or near the blast radius.

source?: Entity

Optional source of the explosion.