# Drawstep engine · Effects · `attach` > Attach — e.g. “attach ~ to target creature”. 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#attach ## Where it goes One step of an ability's `effects[]` (a spell's, a trigger's, an activated ability's, a mode's): `{ "effect": "attach", … }`. Steps resolve in order. Printed words that point here (search aliases): attach equip. ## Fields | Field | Type | Required | Description | |---|---|---|---| | `target` | `TargetDef` | yes | What it acts on (TargetDef) | | `what` | `TargetDef` | no | What to attach (default: the source), e.g. a Role token just created | | `afterMovingFromCreature` | `EffectDef[]` | no | Resolve only if this actually moved the attachment from a different creature | ## Minimal form ```json {"effect":"attach","target":{"of":"object","mode":"chosen","filter":{"types":["Creature"]}}} ``` The engine reads that minimal form as: “attach ~ to target creature”. ## Stock examples - **Grip of Phyresis** — “Gain control of target Equipment, then create a 0/0 black Phyrexian Germ creature token and attach that Equipment to it.” ```json {"effect":"attach","target":{"of":"object","mode":"created"},"what":{"of":"object","mode":"affected","filter":{"subtypes":["Equipment"]}}} ``` - **Thieving Skydiver** — “When this creature enters, if it was kicked, gain control of target artifact with mana value X or less. If that artifact is an Equipment, attach it to this creature.” ```json {"effect":"attach","target":{"of":"object","mode":"self"},"what":{"of":"object","mode":"affected","filter":{"subtypes":["Equipment"]}}} ``` - **Armory Probe** — “When this creature enters, draft a card from Armory Probe's spellbook and put it onto the battlefield. When an Equipment enters this way, attach it to target creature you control.” ```json {"effect":"attach","target":{"of":"object","mode":"chosen","filter":{"types":["Creature"],"controller":"you"}},"what":{"of":"object","mode":"about"}} ``` ## 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