Additional configuration options for the Dimension.createExplosion method.

Example

createExplosions.ts

// 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 });
}

Hierarchy

  • ExplosionOptions

Properties

allowUnderwater?: boolean

Remarks

Whether parts of the explosion also impact underwater.

breaksBlocks?: boolean

Remarks

Whether the explosion will break blocks within the blast radius.

causesFire?: boolean

Remarks

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

source?: Entity

Remarks

Optional source of the explosion.