# Drawstep engine · Effects · `replacement` > Replacement — Create a replacement effect for a duration (default end of turn): "prevent all combat damage that would be dealt this turn", "if that creature would die this turn, exile it instead". once = applies to one event ("the next time …"); budget = the total amount it prevents / redirects ("the next 3 damage"). 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#replacement ## Where it goes One step of an ability's `effects[]` (a spell's, a trigger's, an activated ability's, a mode's): `{ "effect": "replacement", … }`. Steps resolve in order. Printed words that point here (search aliases): prevent the next damage this turn the next time would deal damage instead fog circle of protection floating replacement. ## Fields | Field | Type | Required | Description | |---|---|---|---| | `replacement` | `{ replaces: "event"; event: "damage" \| "draw" \| "drawBatch" \| "beginTurn" \| "beginStep" \| "dies" \| "toGraveyard" \| "leavesBattlefield" \| "enters" \| "destroy" \| "counter" \| "copySpell" \| "untap" \| "cre …` | yes | A general replacement effect: which event, which objects / players / sources, and what happens instead | | `duration` | `Duration` | no | CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes | | `once` | `boolean` | no | Applies only once (to the next matching event), then ends | | `budget` | `ValueDef` | no | Total amount this effect may prevent or redirect ("the next 3 damage") | ## Minimal form ```json {"effect":"replacement","replacement":{"replaces":"event","event":"damage","causedBy":"opponent"}} ``` The engine reads that minimal form as: “if a source would deal damage to ~ this turn, that damage is dealt as normal”. ## Stock examples - **Combat Prevention Study** — “” ```json {"effect":"replacement","replacement":{"replaces":"event","event":"damage","to":{"of":"object","mode":"all"},"toPlayer":"eachPlayer","damageKind":"combat","prevent":true},"duration":"endOfTurn"} ``` - **Prevention Shield Study** — “” ```json {"effect":"replacement","replacement":{"replaces":"event","event":"damage","toPlayer":"you","prevent":true,"then":[{"effect":"gainLife","amount":1}]},"duration":"permanent","budget":2} ``` - **Death Exile Turn** — “If a creature would die this turn, exile it instead.” ```json {"effect":"replacement","replacement":{"replaces":"event","event":"dies","to":{"of":"object","mode":"all","filter":{"types":["Creature"]}},"zone":"exile"},"duration":"endOfTurn"} ``` ## 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