# Drawstep engine · Effects · `counterUnlessPays` > Counter unless pays — CR 701.5, 614.15: counter unless its controller pays amount or cost; destination applies only if countered (library defaults to top unless position specifies otherwise). 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#counterUnlessPays ## Where it goes One step of an ability's `effects[]` (a spell's, a trigger's, an activated ability's, a mode's): `{ "effect": "counterUnlessPays", … }`. Steps resolve in order. Printed words that point here (search aliases): counter unless its controller pays. ## Fields | Field | Type | Required | Description | |---|---|---|---| | `target` | `TargetDef` | no | What it acts on (TargetDef) | | `amount` | `ValueDef` | no | Generic mana to pay | | `cost` | `CostDef` | no | CR 118.12, 608.2c: any other payment instead of amount ("pays {1} and 1 life", "discards their hand") | | `ifPaid` | `EffectDef[]` | no | CR 608.2c: "If they do, …" — run for this effect's controller when the payment is made | | `ifNotPaid` | `EffectDef[]` | no | CR 608.2c: "If that player doesn't, …" — run when the spell's controller doesn't pay (declined or unable), `current` bound to that player (Power Sink) | | `destination` | `"exile" \| "hand" \| "library"` | no | Where the spell goes if it is countered (library = top) | ## Minimal form ```json {"effect":"counterUnlessPays"} ``` The engine reads that minimal form as: “counter target spell unless its controller pays {X}, where X is ?”. ## Stock examples - **Grip of Amnesia** — “Counter target spell unless its controller exiles all cards from their graveyard.” ```json {"effect":"counterUnlessPays","target":{"of":"spell","mode":"chosen","spell":{"controller":"any"}},"cost":{"exileGraveyard":true}} ``` - **Thrull Wizard** — “{1}{B}: Counter target black spell unless that spell's controller pays {B} or {3}.” ```json {"effect":"counterUnlessPays","target":{"of":"spell","mode":"chosen","spell":{"controller":"any","filter":{"colors":["B"]}}},"cost":{"oneOf":[{"mana":"{B}"},{"mana":"{3}"}]}} ``` - **Divert Disaster** — “Counter target spell unless its controller pays {2}. If they do, you create a Lander token.” ```json {"effect":"counterUnlessPays","target":{"of":"spell","mode":"chosen","spell":{"controller":"any"}},"amount":2,"ifPaid":[{"effect":"createToken","who":"you","token":{"name":"Lander","types":["Artifact"],"subtypes":["Lander"],"colors":[],"abilities":[{"kind":"activated","cost":{"mana":"{2}","tapSelf":true,"sacrificeSelf":true},"effects":[{"effect":"searchLibrary","who":"you","filter":{"types":["Land"],"supertypes":["Basic"]},"destination":"battlefield","tapped":true,"reveal":false,"min":0,"max":1,"shuffle":true}]}]},"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) - [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