# Drawstep engine · Effects · `forEachObject` > For each object — CR 608.2c, 608.2h, 400.7: process a fixed object selection once per object. Each body starts with that object as affected; thisWay retains action-time controller/owner information, including tokens. A thisWay target.zone restricts the recorded action destination (CR 614.1), including tokens that later cease to exist. 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#forEachObject ## Where it goes One step of an ability's `effects[]` (a spell's, a trigger's, an activated ability's, a mode's): `{ "effect": "forEachObject", … }`. Steps resolve in order. ## Fields | Field | Type | Required | Description | |---|---|---|---| | `target` | `TargetDef` | yes | What it acts on (TargetDef) | | `effects` | `EffectDef[]` | yes | The effects, resolved in order (EffectDef[]) | | `simultaneous` | `boolean` | no | CR 614.12, 608.2c: the passes' entries are one simultaneous event ("put those cards onto the battlefield" after searching for each); no card entering modifies how another enters | ## Minimal form ```json {"effect":"forEachObject","target":{"of":"object","mode":"chosen","filter":{"types":["Creature"]}},"effects":[]} ``` The engine reads that minimal form as: “for each target creature, ”. ## Stock examples - **Rakdos Charm** — “• Exile target player's graveyard.” ```json {"effect":"forEachObject","target":{"of":"object","mode":"all","filter":{"types":["Creature"]}},"effects":[{"effect":"dealDamage","target":{"of":"player","mode":"all","player":"affectedController"},"amount":1,"from":{"of":"object","mode":"affected"}}]} ``` - **Cleansing** — “For each land, destroy that land unless any player pays 1 life.” ```json {"effect":"forEachObject","target":{"of":"object","mode":"all","filter":{"types":["Land"]}},"effects":[{"effect":"mayPay","cost":{"payLife":1},"then":[],"else":[{"effect":"destroy","target":{"of":"object","mode":"affected"}}],"who":"anyPlayer"}]} ``` - **Object Survey** — “For each creature you control, put a +1/+1 counter on that creature.” ```json {"effect":"forEachObject","target":{"of":"object","mode":"all","filter":{"types":["Creature"],"controller":"you"}},"effects":[{"effect":"addCounters","target":{"of":"object","mode":"affected"},"counter":"+1/+1","amount":1}]} ``` ## 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) - [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