# Drawstep engine · Effects · `addMana` > Add mana — e.g. “add {G}”. Engine: Magic: The Gathering (`mtg`). This is one primitive of the Drawstep card vocabulary; field names and the discriminator are exact. Wiki page: https://drawstep.xyz/wiki/mtg/effects#addMana ## Where it goes One step of an ability's `effects[]` (a spell's, a trigger's, an activated ability's, a mode's): `{ "effect": "addMana", … }`. Steps resolve in order. Printed words that point here (search aliases): add mana {g} {r} mana ability. ## Fields | Field | Type | Required | Description | |---|---|---|---| | `who` | `"you" \| "controller" \| "abilityController" \| "sourceController" \| "owner" \| "eachOpponent" \| "eachPlayer" \| "target" \| "triggeringPlayer" \| "defendingPlayer" \| "attackingPlayer" \| "activePlayer" \| "re …` | no | Which player(s) — a player selector (default `you`) | | `retain` | `"endOfTurn" \| "permanent"` | no | CR 106.4: only mana produced by this instruction survives step/phase ends for the specified duration; spending restrictions are preserved | | `target` | `PlayerTargetDef` | no | CR 601.2c, 608.2h: player targeted by a contextual quantity; mana still goes to who (default you) | | `mana` | `string \| string[]` | yes | Mana symbols to produce; {any} chooses a color, {chosen} uses the chosen color, W\|U chooses one symbol. An array chooses one whole bundle | | `amount` | `ValueDef` | no | Repeat the mana bundle this many times, evaluated on resolution (CR 106.3) | | `oneColor` | `boolean` | no | Choose a single color for all {any} symbols: mana of any one color | | `differentColors` | `boolean` | no | Each mana in this production bundle must have a different color; applies to manual and automatic payment choices (CR 106.3, 608.2d) | | `colorsFromExiled` | `boolean` | no | Choose from the colors of cards currently exiled with this source (CR 106.3, 607.2a) | | `colorsAmong` | `{ filter?: ObjectFilter; zone?: "battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"; who?: any; each?: boolean }` | no | Colors among matching objects: any one of them ({any}), or with each one fixed unit of every such color (CR 105.1, 106.1a, 106.5, 608.2h) | | `colorsFromCommanderIdentity` | `boolean` | no | Choose from the colors in your commander's color identity (CR 903.4); outside a Commander game no mana is produced | | `availableFrom` | `ObjectFilter` | no | Only mana types matching permanents could produce, ignoring their activation costs and spending restrictions (CR 106.7) | | `colorsOnly` | `boolean` | no | For availableFrom: colors only, excluding colorless mana | | `onSpend` | `{ spells: ObjectFilter; abilities?: ObjectFilter \| "any"; by?: "you"; sharesCreatureTypeWithCommander?: boolean; triggered?: boolean; onceEachTurn?: boolean; separateTriggers?: boolean; effects: EffectDef[] }` | no | CR 106.6: each mana unit carries this rider through manual or automatic payment. triggering refers to the spell paid for; you is the mana ability controller | | `restriction` | `{ notSpells?: ObjectFilter; spells?: ObjectFilter; abilities?: ObjectFilter \| "any"; actions?: ("cumulativeUpkeep" \| "foretell" \| "morph" \| "manifest" \| "turnFaceUp" \| "equip" \| "unlockDoor" \| "distur …` | no | Spending permissions joined by OR across spells, abilities, and actions (CR 106.6). Restricted mana empties normally | ## Minimal form ```json {"effect":"addMana","mana":"{G}"} ``` The engine reads that minimal form as: “add {G}”. ## Stock examples - **Mana Rock Study** — “” ```json {"effect":"addMana","mana":"{C}"} ``` - **Wastes** — “” ```json {"effect":"addMana","mana":"{C}"} ``` - **Retained Mana Study** — “” ```json {"effect":"addMana","retain":"endOfTurn","mana":"{R}{R}"} ``` ## Related - [Effects](https://drawstep.xyz/wiki/mtg/effects.md) — the whole topic - [Filters & targets](https://drawstep.xyz/wiki/mtg/targets.md) — how `target` / `filter` select objects and players (selection algebra) - [Values](https://drawstep.xyz/wiki/mtg/values.md) — every number kind an `amount` accepts - [Effects](https://drawstep.xyz/wiki/mtg/effects.md) — the steps a nested `effects` / `then` list may contain - [Start here](https://drawstep.xyz/wiki/mtg/start.md) — the rules, the output contract and the index of every primitive