runWorldCommandId method

void runWorldCommandId(
  1. String? id, {
  2. Map<String, String> replacements = const {},
  3. AssetReference? nullSound,
  4. SoundChannel? soundChannel,
  5. ZoneLevel? zoneLevel,
})

Run the command with the given id.

If the id is null, nothing happens.

Implementation

void runWorldCommandId(
  final String? id, {
  final Map<String, String> replacements = const {},
  final AssetReference? nullSound,
  final SoundChannel? soundChannel,
  final ZoneLevel? zoneLevel,
}) {
  if (id != null) {
    final command = world.getCommand(id);
    runCommand(
      command: command,
      replacements: replacements,
      nullSound: nullSound,
      soundChannel: soundChannel,
      zoneLevel: zoneLevel,
    );
  }
}