# Drawstep engine · Effects · `createToken` > Create token — e.g. “create a colorless creature token”. 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#createToken ## Where it goes One step of an ability's `effects[]` (a spell's, a trigger's, an activated ability's, a mode's): `{ "effect": "createToken", … }`. Steps resolve in order. Printed words that point here (search aliases): create token tokens creature token treasure clue food. ## 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`) | | `also` | `"you" \| "controller" \| "abilityController" \| "sourceController" \| "owner" \| "eachOpponent" \| "eachPlayer" \| "target" \| "triggeringPlayer" \| "defendingPlayer" \| "attackingPlayer" \| "activePlayer" \| "re …` | no | CR 101.4, 111.2, 608.2c: additional creators in the same instruction; each player creates once, in APNAP order (you and that player each create) | | `target` | `PlayerTargetDef` | no | The targeted player who creates these tokens (CR 601.2c, 111.2) | | `attachedTo` | `TargetDef` | no | Create attached to this host before enters triggers (CR 303.4f) | | `token` | `object \| { oneOf: object[]; chooseAtRandom?: boolean; excludeControlled?: boolean }` | yes | The complete inline token spec (TokenSpec: name, types, subtypes, colors, power, toughness, keywords, abilities …) | | `amount` | `ValueDef` | no | How many / how much (integer or ValueDef) | | `tapped` | `boolean` | no | Tapped (true) or untapped (false); on an effect that puts something onto the battlefield, it enters tapped | | `attacking` | `boolean \| "defendingPlayer" \| "current" \| { player: any; orPlaneswalker: true }` | no | Enter attacking, optionally a fixed player: the defending player or current bound by forEachPlayer (CR 508.4). It does not tap the tokens: "tapped and attacking" also sets tapped | | `blocking` | `TargetDef` | no | CR 509.4, 506.3d: enter blocking this attacking creature ("a 0/1 green Plant creature token that's blocking that creature"); for triggers it never "blocked" | | `and` | `({ token: object; amount?: ValueDef })[]` | no | CR 701.7a, 603.2c, 603.6a, 614.12: further token kinds created by the same instruction ("create a 3/3 … Wurm token with deathtouch and a 3/3 … Wurm token with lifelink"): every token is created in one event — token replacement effects apply to the whole event once and all the tokens enter simultaneously, so "one or more tokens enter" triggers once. The other fields apply to every kind | ## Minimal form ```json {"effect":"createToken","token":{"name":"Token"}} ``` The engine reads that minimal form as: “create a colorless creature token”. ## Stock examples - **Restricted Rat Study** — “” ```json {"effect":"createToken","token":{"name":"Rat","types":["Creature"],"subtypes":["Rat"],"colors":["B"],"power":1,"toughness":1,"abilities":[{"kind":"static","effect":{"type":"cantBlock","to":{"of":"object","mode":"self"}}}]}} ``` - **Cohort Summons** — “” ```json {"effect":"createToken","token":{"name":"Cohort Token","types":["Creature"],"subtypes":["Merfolk"],"power":1,"toughness":1},"amount":2} ``` - **Energy Foundry** — “” ```json {"effect":"createToken","token":{"name":"Aetherborn","types":["Creature"],"subtypes":["Aetherborn"],"colors":["B"],"power":{"kind":"var","name":"X"},"toughness":{"kind":"var","name":"X"}}} ``` ## 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 - [Start here](https://drawstep.xyz/wiki/mtg/start.md) — the rules, the output contract and the index of every primitive