Events Guide

Whenever a game event occurs, the event handler will trigger an event. Game objects can subscribe and react to the events (see Implementing a Card for examples).

A triggered event may have one or more parameters that describe more specific information about the event. The names of these parameters are specific to the event.

The different types of events are outlined below, along with an explanation of each event’s respective parameters.

Turn Events

Turn events are events that trigger when a game, turn, phase or step begins or ends.

Event Description Parameters

GAME_BEGAN

GAME_ENDED

The game began (resp. ended).
  • game: <the game object>

TURN_BEGAN

TURN_ENDED

A turn began (resp. ended).
  • player: <the active player>
  • number: <the turn number>

PHASE_BEGAN

PHASE_ENDED

A phase began (resp. ended).
  • phase: <the beginning phase>
  • player: <the relevant player>

Player Events

Player events are triggered for in-game events affecting a player in the game.

Event Description Parameters
PLAYER_CONCEDED A player conceded.
  • player: <the conceding player>
PLAYER_DIED A player died.
  • player: <the dying player>
  • reason: <a reason for death>
DRAW A player drew a card.
  • player: <the drawing player>

LIFE_GAINED

LIFE_LOST

A player gained or lost life.
  • player: <the player>
  • amount: <the amount of life> (always positive)

MANA_ADDED

MANA_REMOVED

Mana was added to or removed from a player’s mana pool.
  • color: "white" / "blue" / "black" / "red" / "green" / "colorless"
  • player: <the player>
  • amount: <the amount of mana> (always positive)

Card & Spell Events

Card and spell events are triggered for events that are relevant to cards, spells and abilities.

Note

Generally the game does not distinguish (currently) between cards and other game objects. They are also referred to as cards for this purpose.

The card and spell events are as follows:

Event Description Parameters
CARD_CAST A card was cast.
  • card: <the casted card>
  • player: <the casting player>
SPELL_COUNTERED A spell was countered.
  • spell: <the countered spell>
SPELL_RESOLVED A spell resolved.
  • spell: <the resolving spell>
STATUS_CHANGED A card’s status was changed.
  • card: <the card>
  • status:
    • "tapped" / "untapped"
    • "flipped" / "unflipped"
    • "face up" / "face down"
    • "phased in" / "phased out"

ENTERED_ZONE

LEFT_ZONE

A card entered or left a zone.
  • card: <the moving card>
  • zone: <the relevant zone>