# Drawstep engine · Effects · `forEachPlayer` > For each player — CR 101.4, 601.2c, 608.2c: process each player in APNAP order, binding current to them. Declare nested chosen targets once per player when putting the spell/ability on the stack. 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#forEachPlayer ## Where it goes One step of an ability's `effects[]` (a spell's, a trigger's, an activated ability's, a mode's): `{ "effect": "forEachPlayer", … }`. Steps resolve in order. ## Fields | Field | Type | Required | Description | |---|---|---|---| | `players` | `"you" \| "controller" \| "abilityController" \| "sourceController" \| "owner" \| "eachOpponent" \| "eachPlayer" \| "target" \| "triggeringPlayer" \| "defendingPlayer" \| "attackingPlayer" \| "activePlayer" \| "re …` | yes | The players iterated in APNAP order (CR 101.4); any player selector | | `effects` | `EffectDef[]` | yes | The effects, resolved in order (EffectDef[]) | | `atAnnouncement` | `true` | no | CR 601.2c, 603.3d: fix the players when targets are announced, including when no player qualifies | | `simultaneous` | `boolean` | no | CR 608.2c, 120.2b: the passes are one simultaneous damage event ("~ deals damage to each player equal to the number of nonbasic lands that player controls"; Incite Rebellion: the damage is dealt simultaneously) — lifelink gains once and each prevention effect triggers and finishes once (CR 120.3f, 615.13, 615.5) | ## Minimal form ```json {"effect":"forEachPlayer","players":"you","effects":[],"atAnnouncement":true} ``` The engine reads that minimal form as: “for each you, ”. ## Stock examples - **Windgrace's Judgment** — “For any number of opponents, destroy target nonland permanent that player controls.” ```json {"effect":"forEachPlayer","players":"eachOpponent","effects":[{"effect":"choose","kind":"object","target":{"of":"object","mode":"chosen","filter":{"notTypes":["Land"],"controller":"current"},"min":0,"max":1}}]} ``` - **Opponent Flame** — “For each opponent, Opponent Flame deals 3 damage to up to one target creature that player controls.” ```json {"effect":"forEachPlayer","players":"eachOpponent","effects":[{"effect":"dealDamage","target":{"of":"object","mode":"chosen","filter":{"types":["Creature"]},"player":"current","min":0,"max":1},"amount":3}]} ``` - **Stampede Witness** — “Whenever this creature attacks, for each opponent, you create a 2/2 green Boar creature token that's tapped and attacking that opponent.” ```json {"effect":"forEachPlayer","players":"eachOpponent","effects":[{"effect":"createToken","who":"you","token":{"name":"Boar","types":["Creature"],"subtypes":["Boar"],"colors":["G"],"power":2,"toughness":2},"amount":1,"tapped":true,"attacking":"current"}]} ``` ## Related - [Effects](https://drawstep.xyz/wiki/mtg/effects.md) — the whole topic - [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