For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/ExplosionOptions.md.

Interface: ExplosionOptions

Beta

Dimension.createExplosion 方法的附加配置选项。

Examples

createNoBlockExplosion.ts
createExplosions.ts
import { DimensionLocation } from '@minecraft/server';
import { Vector3Utils } from '@minecraft/math';

function createNoBlockExplosion(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) {
  const explodeNoBlocksLoc = Vector3Utils.floor(Vector3Utils.add(targetLocation, { x: 1, y: 2, z: 1 }));

  log('Creating an explosion of radius 15 that does not break blocks.');
  targetLocation.dimension.createExplosion(explodeNoBlocksLoc, 15, { breaksBlocks: false });
}

Properties

allowUnderwater?

optional allowUnderwater?: boolean

Beta

Remarks

爆炸是否也会影响水下区域。

Whether parts of the explosion also impact underwater.


breaksBlocks?

optional breaksBlocks?: boolean

Beta

Remarks

爆炸是否会破坏爆炸半径内的方块。

Whether the explosion will break blocks within the blast radius.


causesFire?

optional causesFire?: boolean

Beta

Remarks

如果为 true,爆炸会在爆炸半径内或附近伴随火焰。

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


source?

optional source?: Entity

Beta

Remarks

可选的爆炸来源。

Optional source of the explosion.