Skip to content

@lands.io/mod-sdk / Execution

Interface: Execution

An execution is a running game action (attack, spawn, etc.) Mods can create custom executions by implementing this interface.

Table of contents

Methods

Methods

activeDuringSpawnPhase

activeDuringSpawnPhase(): boolean

Whether this execution runs during spawn phase

Returns

boolean


init

init(game, ticks): void

Called when the execution is added to the game

Parameters

Name Type
game Game
ticks number

Returns

void


isActive

isActive(): boolean

Whether this execution is still active

Returns

boolean


owner

owner(): null | Player

The player who owns this execution (null for system executions)

Returns

null | Player


tick

tick(ticks): void

Called each game tick

Parameters

Name Type
ticks number

Returns

void


Source Code

View full implementation
/**
 * An execution is a running game action (attack, spawn, etc.)
 * Mods can create custom executions by implementing this interface.
 */
export interface Execution {
  /** Whether this execution is still active */
  isActive(): boolean;

  /** Whether this execution runs during spawn phase */
  activeDuringSpawnPhase(): boolean;

  /** Called when the execution is added to the game */
  init(game: Game, ticks: number): void;

  /** Called each game tick */
  tick(ticks: number): void;

  /** The player who owns this execution (null for system executions) */
  owner(): Player | null;
}