# Drawstep engine wiki — Replacements > Effects that rewrite an event before it happens: enters tapped, enters with counters, exile instead of dying, … Engine: Magic: The Gathering (`mtg`). Page: https://drawstep.xyz/wiki/mtg/replacements · Raw Markdown: https://drawstep.xyz/wiki/mtg/replacements.md · Complete AI pack (every topic in one document, with the output contract and worked examples): https://drawstep.xyz/wiki/drawstep-mtg-ai-pack.md. This page is generated from Drawstep's card schema; field names and discriminators are exact. A card definition is one JSON object; anything the vocabulary cannot express goes verbatim into `unparsed` instead of being approximated. ## Replacement effects (`ReplacementDef`, discriminator `replaces`) Used as `{ kind: "replacement", replacement: {…} }`. - `entersTapped` — e.g. “~ enters tapped”. Fields: `applyTo?`: TargetDef — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events); `unless?`: ConditionDef — Enters untapped if this holds ("unless you control two or more other lands"); `unlessPay?`: CostDef — "As ~ enters, you may pay …. If you don't, it enters tapped."; `castBy?`: "you" | "opponent" — Only a spell cast by you / by an opponent that enters the battlefield (CR 601.2a, 614.1c): "Creatures played by your opponents enter tapped" (Uphill Battle). Entering without being cast (put onto the battlefield, copied, reanimated) doesn't match. - `entersUntapped` — CR 614.1c, 614.12, 616.1: "Lands you control enter untapped". A permanent an instruction puts onto the battlefield tapped enters untapped; if another replacement would have it enter tapped, its controller chooses the order (so whether it enters tapped). Permanents entering together with the source aren't affected. Fields: `applyTo?`: TargetDef — The entering permanents it applies to ("lands you control", `mode: all`); default the source itself; `condition?`: ConditionDef — Read as the permanent would enter ("as long as ~ is untapped"). - `entersWithCounters` — e.g. “~ enters with a +1/+1 counter on it”. Fields: `counter?`: string | string[] — The counter kind (default +1/+1). A list is "your choice of a trample counter or a menace counter" — the replacement's controller picks as it applies (CR 122.1b, 614.1c); `chooseKinds?`: number — With a list: choose this many different kinds, `amount` of each ("your choice of two different counters from among menace, deathtouch, and lifelink"); `amount`: ValueDef — How many / how much (integer or ValueDef); `additional?`: boolean — Counters in addition to those it would otherwise enter with (CR 122.6); `applyTo?`: TargetDef — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events); `condition?`: ConditionDef — A ConditionDef that must hold. - `entersUnlessSacrifice` — CR 614.12a: Scorched Ruins / Lotus Vale entry replacement. Fields: `sacrifice`: { of: "object" | "player" | "spell" | "ability" | "spellOrAbility" | "any"; slot?: string; mode?: "chosen" | "choose" | "all" | "self" | "random" | "host" | "triggering" | "created" | "convoked" | "linked" | "paired" | "top" | "affected" | "replaced" | "replacedSource" | "triggeringOther" | "about" | "thisWay" | "costPaid" | "attacked" | "grantor"; action?: "sacrificed" | "milled" | "destroyed" | "exiled" | "discarded" | "returned" | "putIntoLibrary" | "tapped" | "untapped" | "damaged" | "drawn" | "revealed" | "countersPlaced" | "countersRemoved" | "amassed" | "countered" | "phasedOut" | "searched" | "created"; among?: "triggering"; chooser?: any; random?: true; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; allZones?: boolean; position?: "top" | "bottom"; filter?: ObjectFilter; player?: any; playerOwns?: true; exceptPlayer?: any; playerFilter?: "opponent"; sameZoneOwner?: boolean; maxTotalManaValue?: ValueDef; maxTotalPower?: ValueDef; distinctBy?: "name" | "manaValue" | "controller" | "power"; equalBy?: "toughness" | "power" | "manaValue"; sharesType?: "card" | "permanent"; sharedBy?: "creatureType"; zones?: ("battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command")[]; playerTarget?: PlayerTargetDef; digSubset?: "looked" | "picked" | "rest"; span?: number; targetCount?: number; targetsOnlySource?: boolean; permanents?: true; stackTargets?: object; spell?: object; ability?: object; min?: ValueDef; max?: ValueDef | "any"; differentFromEarlierTargets?: boolean; attacker?: "self" | "triggering"; label?: string } — Permanents its would-be controller must sacrifice before it enters; failure puts this card into its owner's graveyard. - `asEnters` — CR 614.1c, 614.12: "As this enters, ": performed as part of the entry, before the permanent is on the battlefield; its own entersWithCounters read the results (doneThisWay, ifYouDo). Fields: `effects`: EffectDef[] — The effects, resolved in order (EffectDef[]); `condition?`: ConditionDef — A ConditionDef that must hold. - `asAttaches` — Make and remember a color choice as this becomes attached to a new matching object (Sanctuary Blade). Fields: `filter`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `key?`: string — Storage key of a noted value or choice (defaults to the choice's kind). - `turnedFaceUp` — CR 614.1c, 702.37e: "As this creature is turned face up, " (morph): performed as part of turning it face up, before its turned-face-up triggers. Fields: `effects`: EffectDef[] — The effects, resolved in order (EffectDef[]); `condition?`: ConditionDef — A ConditionDef that must hold. - `preventDamage` — e.g. “prevent all damage that would be dealt to ~”. Fields: `amount?`: ValueDef — How many / how much (integer or ValueDef); `combatOnly?`: boolean — Only combat damage; `applyTo?`: TargetDef — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events); `fromFilter?`: ObjectFilter — Only damage from sources matching this filter. - `diesToExile` — e.g. “if ~ would die, exile it instead”. Fields: `applyTo?`: TargetDef — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events). - `entersAsCopyOfHost` — CR 614.12, 616.1c: matching permanents enter as a copy of the permanent this source is attached to. Fields: `applyTo`: { native?: object; exclude?: any; anyOf?: ObjectFilter[]; types?: string[]; anyTypes?: string[]; subtypes?: string[]; supertypes?: string[]; colors?: string[]; notTypes?: string[]; notSubtypes?: string[]; notSupertypes?: string[]; notColors?: string[]; colorless?: boolean; multicolored?: boolean; monocolored?: boolean; colorCount?: number; minCardTypes?: number; controller?: Relation; owner?: "you" | "opponent" | "any" | "notYou" | "current"; kicked?: boolean; sharesColorWithTriggeringMana?: boolean; manaSpentToCast?: object; manaSpentFrom?: object; castFrom?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; notCastFrom?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; convoked?: boolean; enteredFrom?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; hasHybridMana?: boolean; manaCostContains?: string; hasAdventure?: boolean; withKeyword?: string; hasBasicLandType?: boolean; hasNonbasicLandType?: boolean; withKeywordAbility?: string; withoutKeywordAbility?: string; withTapAbility?: boolean; withAbility?: "activated" | "triggered" | "mana" | "nonManaActivated"; withoutManaAbility?: boolean; withoutAbilities?: boolean; withoutKeyword?: any; tapped?: boolean; isRingBearer?: boolean; isToken?: boolean; attacking?: boolean; attackingAlone?: boolean; tappedForSourceThisTurn?: "crew" | "saddle"; attackedThisTurn?: boolean; canAttack?: boolean; blockedThisTurn?: boolean; wasBlockedThisTurn?: boolean; attackingPlayer?: any; attackingPlaneswalkerControlledBy?: any; blocking?: boolean; blocked?: boolean; modified?: boolean; bandedWithSource?: boolean; minPowerOrToughness?: number; maxPowerOrToughness?: number; minPowerPlusToughness?: number; maxPowerPlusToughness?: number; minPower?: number; maxBasePower?: number; maxBaseToughness?: number; basePower?: number; baseToughness?: number; powerAboveBase?: boolean; maxPower?: number; minToughness?: number; maxToughness?: number; minToughnessValue?: any; maxToughnessValue?: any; minManaValueValue?: any; minManaValue?: number; maxManaValue?: number; manaValueValue?: any; manaValues?: number[]; manaCosts?: string[]; maxManaValueValue?: any; manaValueVar?: string; hasCounter?: string; inZone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; suspended?: boolean; withoutCounter?: string; self?: boolean; other?: boolean; otherThanTrigger?: boolean; otherThanAffected?: boolean; name?: string; nameOf?: "self" | "affected"; host?: boolean; attachedToSource?: boolean; attachedToReference?: "affected" | "triggering" | "triggeringOther"; attachedTo?: any; sharesWithHost?: "creatureType" | "color" | "cardType"; attachedToHost?: boolean; enchanted?: boolean; hasAttachment?: object; enchantedByOther?: boolean; equipped?: boolean; notAffected?: boolean; notChosenSubtype?: boolean | string; chosenSubtype?: boolean | string; chosenColor?: boolean | string; chosenParity?: boolean | string; chosenPowerParity?: boolean | string; manaValueParity?: "odd" | "even"; chosenKind?: boolean | string; chosenType?: boolean | string; chosenName?: boolean | string; chosenBy?: "controller" | "owner"; comparedToSource?: object; comparedToTrigger?: object; maxManaValueVar?: string; minManaValueVar?: string; minPowerValue?: any; maxPowerVar?: string; maxPowerValue?: any; designation?: string; withoutDesignation?: string; attachedToSameHost?: boolean; isCommander?: boolean; linkedToSource?: boolean; putWithSource?: boolean; phasedOut?: boolean; faceDown?: boolean; sharesWithSource?: "creatureType" | "cardType" | "color" | "name"; sharesWithSacrificed?: "creatureType" | "cardType" | "color" | "name"; notSharesLandTypeWith?: object; sharesWithTarget?: "creatureType" | "cardType" | "color" | "name"; sharesWith?: object; comparedTo?: object; attachedToSelection?: any; inSelection?: any; targetableByTriggering?: boolean; targetOfTriggering?: boolean; controllerOfTriggeringTarget?: boolean; combatWith?: object; discardedThisTurn?: boolean; enteredGraveyardThisTurn?: true | "fromAnywhere" | "fromBattlefield" | "fromLibrary" | "milled"; attached?: boolean; enteredThisTurn?: boolean; alreadyOnBattlefield?: boolean; enteredThisTurnUnder?: any; damagedThisTurn?: boolean; dealtDamageThisTurn?: boolean; dealtDamageToThisTurn?: any; dealtCombatDamageToThisTurn?: any; counterPlacedThisTurnBy?: "you"; damagedBySource?: boolean; damagedByHost?: boolean; damagedThisTurnBy?: any; drawnThisTurn?: boolean; fromStartingDeck?: boolean; minCounters?: number; hasSticker?: "any" | "name" | "art" | "ability" | "pt"; onSprocket?: 1 | 2 | 3 | "crank"; isHost?: boolean; hasAugment?: boolean } — Entering objects to which the copy effect applies, relative to the attached source controller. - `entersAsCopy` — e.g. “you may have ~ enter as a copy of any creature on the battlefield”. Fields: `exceptIfEmbalmed?`: { keywords?: string[]; keywordAbilities?: KeywordAbilityDef[]; abilities?: any[]; addTypes?: string[]; addSubtypes?: string[]; setTypes?: string[]; setSubtypes?: string[]; removeSubtypes?: string[]; colors?: string[]; addColors?: string[]; power?: ValueDef; toughness?: ValueDef; loyalty?: ValueDef; notLegendary?: boolean; legendary?: boolean; name?: string; noManaCost?: boolean } — CR 707.9, 702.128a: apply these copiable exceptions when this token enters from resolving an embalm ability; `exilePairForCounters?`: { counter: string; property: "power" | "toughness" } — CR 614.12, 707.9e: exile two matching cards from graveyards, copy one and enter with additional counters equal to the other card's specified characteristic; `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `zone?`: "battlefield" | "graveyard" | "exile" — Zone containing the copy model; default battlefield (CR 707.2, 614.12); `tapped?`: boolean — Enter tapped if the copy option is chosen; declining preserves normal entry (CR 614.12); `withCounters?`: { counter: string; amount: ValueDef } — Additional entry counters when copying; not part of the copiable values (CR 707.9e, 122.6); `additionalCounters?`: ({ counter: string; amount: ValueDef; filter?: ObjectFilter })[] — Additional entry counters when copying, combined with initial counters; not copiable (CR 707.9e, 122.6); `optional?`: boolean — "You may": the player chooses whether to do it; `except?`: { keywords?: string[]; keywordAbilities?: KeywordAbilityDef[]; abilities?: any[]; addTypes?: string[]; addSubtypes?: string[]; setTypes?: string[]; setSubtypes?: string[]; removeSubtypes?: string[]; colors?: string[]; addColors?: string[]; power?: ValueDef; toughness?: ValueDef; loyalty?: ValueDef; notLegendary?: boolean; legendary?: boolean; name?: string; noManaCost?: boolean } — Except: apply before entry, including added enters abilities (CR 707.9); `condition?`: ConditionDef — CR 614.12: the replacement applies only while this holds as it would enter ("Raid — If you attacked this turn, you may have ~ enter as a copy of any creature on the battlefield", Protean Raider). - `draw` — "If you would draw a card, instead …" (dredge-like). Fields: `optional?`: boolean — "You may": the player chooses whether to do it; `then`: EffectDef[] — Effects that follow ("then …", "if you do …"); `applyTo?`: "you" | "controller" | "abilityController" | "sourceController" | "owner" | "eachOpponent" | "eachPlayer" | "target" | "triggeringPlayer" | "defendingPlayer" | "attackingPlayer" | "activePlayer" | "replacedPlayer" | "damageSourceController" | "causeController" | "affectedController" | "affectedOwner" | "triggeringController" | "triggeringOwner" | "triggeringOtherController" | "triggeringOtherOwner" | "current" | "previousPlayer" | "mostLife" | "leastLife" | "mostCardsInHand" | "fewestCardsInHand" | "enchantedPlayer" | "yourTeam" | "chosenPlayer" | "playerToYourLeft" | "playerToYourRight" | "attackedPlayers" | "attackingOpponents" | "attackedBySourceThisTurn" | "attackedBySourceLastCombat" | object — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events). - `toGraveyard` — "If ~ would be put into a graveyard from anywhere, exile it instead". Fields: `instead`: "exile" | "shuffleIntoLibrary" | "hand" — Where it goes instead: exile, shuffled into its owner's library, or its owner's hand; `applyTo?`: TargetDef — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events); `fromBattlefieldOnly?`: boolean — Only when it would go to the graveyard from the battlefield. - `entersDesignated` — "~ enters prepared": enters with the designation. Fields: `designation`: string — A designation name (monarch, monstrous, renowned, saddled, suspected, prepared …); `applyTo?`: TargetDef — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events). - `lifeGain` — "If you would gain life, you gain twice that much instead". Fields: `applyTo?`: "you" | "controller" | "abilityController" | "sourceController" | "owner" | "eachOpponent" | "eachPlayer" | "target" | "triggeringPlayer" | "defendingPlayer" | "attackingPlayer" | "activePlayer" | "replacedPlayer" | "damageSourceController" | "causeController" | "affectedController" | "affectedOwner" | "triggeringController" | "triggeringOwner" | "triggeringOtherController" | "triggeringOtherOwner" | "current" | "previousPlayer" | "mostLife" | "leastLife" | "mostCardsInHand" | "fewestCardsInHand" | "enchantedPlayer" | "yourTeam" | "chosenPlayer" | "playerToYourLeft" | "playerToYourRight" | "attackedPlayers" | "attackingOpponents" | "attackedBySourceThisTurn" | "attackedBySourceLastCombat" | object — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events); `multiply?`: number — Multiplier ("twice that much" = 2); `add?`: number — Amount added ("that much plus N"); `prevent?`: boolean — The event doesn't happen at all. - `damageDealt` — Damage dealt to the affected is doubled / increased. Fields: `applyTo?`: TargetDef — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events); `multiply?`: number — Multiplier ("twice that much" = 2); `add?`: number — Amount added ("that much plus N"). - `event` — A general replacement effect: which event, which objects / players / sources, and what happens instead. Fields: `event`: "damage" | "draw" | "drawBatch" | "beginTurn" | "beginStep" | "dies" | "toGraveyard" | "leavesBattlefield" | "enters" | "destroy" | "counter" | "copySpell" | "untap" | "createTokens" | "putCounters" | "lifeGain" | "lifeLoss" | "loseGame" | "loseMana" | "addMana" | "mill" | "searchLibrary" | "rollDice" | "flipCoin" | "explore" | "connive" | "scry" | "proliferate" | "setInMotion" — CR 614-616: watch countering spells (701.6), damage, individual or batch draws (121.2a), turn/step beginnings (500, 614.10), zone changes and entry (614.12), token creation (111), counters (122), life and game loss (104), mana production or loss (106), searches (701.23), keyword actions (701), and dice/coin result sets (705-706); `to?`: TargetDef — The object(s) the event would happen to (default: the source itself when toPlayer is absent — or, for a damage event with `from` written, whatever that source would damage): mode all + filter, self, host, or — created by the one-shot effect — chosen / affected; `toPlayer?`: "you" | "controller" | "abilityController" | "sourceController" | "owner" | "eachOpponent" | "eachPlayer" | "target" | "triggeringPlayer" | "defendingPlayer" | "attackingPlayer" | "activePlayer" | "replacedPlayer" | "damageSourceController" | "causeController" | "affectedController" | "affectedOwner" | "triggeringController" | "triggeringOwner" | "triggeringOtherController" | "triggeringOtherOwner" | "current" | "previousPlayer" | "mostLife" | "leastLife" | "mostCardsInHand" | "fewestCardsInHand" | "enchantedPlayer" | "yourTeam" | "chosenPlayer" | "playerToYourLeft" | "playerToYourRight" | "attackedPlayers" | "attackingOpponents" | "attackedBySourceThisTurn" | "attackedBySourceLastCombat" | object — The player(s) the event would happen to: damaged, drawing, gaining / losing, milling; the controller tokens / counters would go to; `from?`: TargetDef — damage: the source must match ("a red source", "creatures", "sources you don't control", of: spell = "a spell"); mode choose = "a source of your choice", picked as the effect resolves. putCounters: the source of the effect placing the counters (mode all + filter other = "by a source other than this one"). With to self, counter and prevent: true that is "Adaptation counters can't be put on ~ except by its own abilities" — proliferate and every other spell or ability are stopped, the card's own abilities still put them (CR 122.1, 614.1a); `by?`: "you" | "controller" | "abilityController" | "sourceController" | "owner" | "eachOpponent" | "eachPlayer" | "target" | "triggeringPlayer" | "defendingPlayer" | "attackingPlayer" | "activePlayer" | "replacedPlayer" | "damageSourceController" | "causeController" | "affectedController" | "affectedOwner" | "triggeringController" | "triggeringOwner" | "triggeringOtherController" | "triggeringOtherOwner" | "current" | "previousPlayer" | "mostLife" | "leastLife" | "mostCardsInHand" | "fewestCardsInHand" | "enchantedPlayer" | "yourTeam" | "chosenPlayer" | "playerToYourLeft" | "playerToYourRight" | "attackedPlayers" | "attackingOpponents" | "attackedBySourceThisTurn" | "attackedBySourceLastCombat" | object — The controller of the effect creating tokens, placing counters, or countering a spell; `lifeLossBy?`: "you" | "controller" | "abilityController" | "sourceController" | "owner" | "eachOpponent" | "eachPlayer" | "target" | "triggeringPlayer" | "defendingPlayer" | "attackingPlayer" | "activePlayer" | "replacedPlayer" | "damageSourceController" | "causeController" | "affectedController" | "affectedOwner" | "triggeringController" | "triggeringOwner" | "triggeringOtherController" | "triggeringOtherOwner" | "current" | "previousPlayer" | "mostLife" | "leastLife" | "mostCardsInHand" | "fewestCardsInHand" | "enchantedPlayer" | "yourTeam" | "chosenPlayer" | "playerToYourLeft" | "playerToYourRight" | "attackedPlayers" | "attackingOpponents" | "attackedBySourceThisTurn" | "attackedBySourceLastCombat" | object — Only life loss caused by a spell or ability controlled by these players. Payments of life have no causing controller; `damageKind?`: "combat" | "noncombat" — damage: only combat / only noncombat damage; `minAmount?`: ValueDef — The event's amount must be at least this ("3 or more damage"); `maxAmount?`: ValueDef — CR 615.1a: only damage events no greater than this amount ("3 or less damage"); `exactAmount?`: ValueDef — CR 614.1a: only damage events of exactly this amount ("exactly 2 damage"); `counter?`: string — putCounters: only this kind of counter; `extraTurnOnly?`: boolean — CR 500.7 / 614.10: watch only extra turns; `step?`: "untap" | "draw" — CR 502 / 504: step whose beginning is replaced; `duringUntapStep?`: boolean — CR 502.3: only during the object's controller's untap step; `firstEachTurn?`: boolean — CR 614.1a: first matching event each turn for each affected player; `manaColor?`: string — CR 106: transform retained or produced mana to this type, retaining spending restrictions; "any" = a color of the producer's choice, "chosen" = the color chosen as this ability resolved; `coloredManaOnly?`: boolean — CR 106.1: transform colored mana only; `manaFromColors?`: string[] — CR 106.1: transform only mana of these types ("instead of white mana"); `manaPlayers?`: "you" | "controller" | "abilityController" | "sourceController" | "owner" | "eachOpponent" | "eachPlayer" | "target" | "triggeringPlayer" | "defendingPlayer" | "attackingPlayer" | "activePlayer" | "replacedPlayer" | "damageSourceController" | "causeController" | "affectedController" | "affectedOwner" | "triggeringController" | "triggeringOwner" | "triggeringOtherController" | "triggeringOtherOwner" | "current" | "previousPlayer" | "mostLife" | "leastLife" | "mostCardsInHand" | "fewestCardsInHand" | "enchantedPlayer" | "yourTeam" | "chosenPlayer" | "playerToYourLeft" | "playerToYourRight" | "attackedPlayers" | "attackingOpponents" | "attackedBySourceThisTurn" | "attackedBySourceLastCombat" | object — CR 106.1: produce the same mana for these players instead; `manaAdditional?`: string[] — CR 106.1: extra mana types produced in the same event; `manaMultiply?`: number — CR 106.1, 614.1a: "it produces twice as much of that mana instead" — every unit produced that many times, of the same type; `manaExact?`: string — CR 106.1, 614.1a: "it produces {B} instead of any other type and amount" — the whole production becomes exactly this mana string ({any} = a color of the producer's choice); `manaOneColor?`: boolean — With manaExact {any}…: every unit is the same chosen color ("three mana of a color of your choice"); `tappedForMana?`: boolean — CR 605.1b wording "is tapped for mana" / "you tap … for mana": only mana a {T} mana ability of the source produces, not rituals or other abilities; `enterController?`: "you" | "controller" | "abilityController" | "sourceController" | "owner" | "eachOpponent" | "eachPlayer" | "target" | "triggeringPlayer" | "defendingPlayer" | "attackingPlayer" | "activePlayer" | "replacedPlayer" | "damageSourceController" | "causeController" | "affectedController" | "affectedOwner" | "triggeringController" | "triggeringOwner" | "triggeringOtherController" | "triggeringOtherOwner" | "current" | "previousPlayer" | "mostLife" | "leastLife" | "mostCardsInHand" | "fewestCardsInHand" | "enchantedPlayer" | "yourTeam" | "chosenPlayer" | "playerToYourLeft" | "playerToYourRight" | "attackedPlayers" | "attackingOpponents" | "attackedBySourceThisTurn" | "attackedBySourceLastCombat" | object — CR 614.12 / 616.1b: enters under this player's control instead; `chooseEnterController?`: boolean — CR 614.12, 616.1b: "enters under the control of an opponent of your choice" — the replacement's controller chooses one of the players enterController names (no targeting) as it would enter; `enterTapped?`: boolean — CR 614.1c: enters tapped instead; `enterAttacking?`: boolean — CR 508.4: enters attacking a legal defender instead; `enterCounters?`: ({ counter: string; amount: ValueDef })[] — CR 614.1c, 122.6: it enters with these additional counters ("this turn, each creature you control enters with an additional +1/+1 counter on it"); `enterAs?`: EffectDef[] — CR 614.1c, 614.12: continuous effects the entering permanent gets as it enters (target `{ mode: "affected" }`, duration permanent), before its enters abilities trigger — "enters … as a Mutant in addition to its other types" (becomeType), "it becomes a 7/7 Dinosaur creature in addition to its other types" (becomeType + setPT); `tokenReplace?`: object[] — CR 111 / 614.1a: each replaced token becomes one of each spec; `tokenChoices?`: object[] — CR 111 / 614.1a: choose one token spec for the whole event; `tokenAdditional?`: object[] — CR 111 / 614.1a: keep the tokens and add that many of each spec; `tokenAdditionalOnce?`: object[] — CR 614.1a, 614.5, 616.1: add one of each spec to this same creation event; prior replacements do not apply again; `shuffleOwnedIntoLibrary?`: boolean — CR 104.4 / 614.1a: shuffle the affected player's hand, graveyard and all owned permanents into their library; `randomResults?`: { add?: number; multiply?: number; ignore?: "lowest" | "chosen"; chooser?: "you" | "replacedPlayer"; perDie?: boolean; oneDie?: boolean; sum?: boolean } — CR 706.6 / 705: enlarge a result set, ignore results before triggers, or use its sum; `dieSides?`: number — CR 706: only dice with this many sides; `searchTop?`: number — CR 701.23: restrict the searchable library domain to its top N cards; `ownLibrary?`: boolean — searchLibrary: only a search of the searching player's own library ("while an opponent is searching their library"). With zone, every card that search finds goes to that zone instead of where the instruction would put it; the instruction's other effects can't see them, and `then` runs on them as `affected` (Opposition Agent: zone exile, then exileMayPlay). Several such effects: the player controlling the search chooses one (CR 616.1); `regenerate?`: boolean — CR 614.8 / 701.19: regenerate now instead of destruction, unless prohibited; `removeDamage?`: boolean — CR 701.8: remove all marked damage instead of destruction; `removeCounterToUntap?`: string — CR 122.2 / 614.1a: remove one counter instead of untapping; untap only when a counter was actually removed; `removeAllCounters?`: string — CR 122.2: remove all counters of this kind instead; `tokenFilter?`: ObjectFilter — createTokens: only tokens matching this filter ("one or more Treasure tokens"); `fromZone?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — toGraveyard / enters: the object must move from this zone; `toZone?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — leavesBattlefield: the object would move to this zone ("if enchanted creature would be exiled" = exile); `orEvents?`: ({ event: "damage" | "draw" | "drawBatch" | "beginTurn" | "beginStep" | "dies" | "toGraveyard" | "leavesBattlefield" | "enters" | "destroy" | "counter" | "copySpell" | "untap" | "createTokens" | "putCounters" | "lifeGain" | "lifeLoss" | "loseGame" | "loseMana" | "addMana" | "mill" | "searchLibrary" | "rollDice" | "flipCoin" | "explore" | "connive" | "scry" | "proliferate" | "setInMotion"; fromZone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; toZone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" })[] — CR 614.1a: further events the same replacement watches — "if enchanted creature would be destroyed or exiled" = event destroy + orEvents [{ event: leavesBattlefield, toZone: exile }]. All other match fields (to, toPlayer, condition, …) and all result fields are shared; the replacement still applies only once to one event (CR 614.5); `discarded?`: boolean — CR 701.9a: toGraveyard — only a discard; `causedBy?`: "opponent" — CR 701.9a, 614.1a: only an event a spell or ability an opponent controls causes; `notCast?`: boolean — enters: only permanents that weren't cast; `exceptFirstInDrawStep?`: boolean — draw: not the first card the player draws in each of their draw steps; `condition?`: ConditionDef — Checked as the event would happen ("while you have 5 or less life", "if you control a creature"); `optional?`: boolean — "You may … instead" (draw / createTokens / lifeGain); `prevent?`: boolean — The event doesn't happen at all; `preventAmount?`: ValueDef — CR 615.1a / 615.6: prevent this much of each damage event. Math over replaced.amount supports half that damage with rounding; `preventAllBut?`: ValueDef — damage: prevent all but this much; `multiply?`: number — "twice that much" = 2; `add?`: ValueDef — "that much plus N"; `newTargets?`: boolean — CR 707.10c: allow new targets for extra spell copies supplied by this copySpell replacement, even when original copies retain their targets; `addDieRoll?`: number — CR 614.1a / 706: add the result of a die with this many sides to damage, with normal roll replacements and triggers; `half?`: "up" | "down" — "half that damage, rounded up / down"; `set?`: ValueDef — The amount becomes this instead; `redirectTo?`: TargetDef — damage: dealt to this object or player instead; `lifeFloor?`: ValueDef — damage to a player: can't reduce the life total below this; `zone?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — Zone-change events: the object goes here instead. searchLibrary with ownLibrary: the found cards go here instead; `position?`: "top" | "bottom" — With `zone: "library"`: top or bottom; `shuffle?`: boolean — With zone library: shuffle it in; `link?`: boolean — CR 400.7: a card moved to exile (or the command zone) by this replacement is "exiled with" the source — linked to that incarnation of it, so the source's playLinkedExile / castLinkedExile permission and `linked` selections cover it (Valgavoth, Terror Eater: "exile it instead. During your turn, you may play cards exiled with Valgavoth"); `instead?`: EffectDef[] — Effects that happen instead of the event (the event itself doesn't). On dies / toGraveyard / leavesBattlefield with no zone written, the zone change does not happen and these run in its place ("if enchanted creature would be destroyed, instead it phases out"); a moveTo of the replaced permanent with destination battlefield there returns it to the battlefield as a new object (CR 400.7) — "If ~ would leave the battlefield, return it to the battlefield under an opponent's control instead" (controller: opponent): its counters, damage, attachments and the effects on it are gone, enters abilities trigger and leaves abilities don't; `then?`: EffectDef[] — Effects that also happen right after the (modified or prevented) event. ### Stock examples - `entersTapped` — Uphill Battle: “Creatures played by your opponents enter tapped.” → `{"replaces":"entersTapped","applyTo":{"of":"object","mode":"all","filter":{"types":["Creature"]}},"castBy":"opponent"}` - `entersUntapped` — Archelos, Lagoon Mystic: “As long as Archelos is untapped, other permanents enter untapped.” → `{"replaces":"entersUntapped","applyTo":{"of":"object","mode":"all","filter":{"other":true}},"condition":{"kind":"not","condition":{"kind":"sourceTapped"}}}` - `entersWithCounters` — Escape Witness: “This creature escapes with two +1/+1 counters on it.” → `{"replaces":"entersWithCounters","counter":"+1/+1","amount":2,"condition":{"kind":"castWith","alternative":"escape"}}` - `entersUnlessSacrifice` — Scorched Ruins: “If this land would enter, sacrifice two untapped lands instead. If you do, put this land onto the battlefield. If you don't, put it into its owner's graveyard.” → `{"replaces":"entersUnlessSacrifice","sacrifice":{"of":"object","mode":"choose","filter":{"types":["Land"],"controller":"you","tapped":false},"min":2,"max":2}}` - `asEnters` — Ixidron: “As this creature enters, turn all other nontoken creatures face down.” → `{"replaces":"asEnters","effects":[{"effect":"turnFaceDown","target":{"of":"object","mode":"all","filter":{"types":["Creature"],"isToken":false,"other":true}}}]}` - `turnedFaceUp` — Hooded Hydra: “As this creature is turned face up, put five +1/+1 counters on it.” → `{"replaces":"turnedFaceUp","effects":[{"effect":"addCounters","target":{"of":"object","mode":"self"},"counter":"+1/+1","amount":5}]}` - `entersAsCopy` — Progenitor Mimic Witness: “” → `{"replaces":"entersAsCopy","filter":{"types":["Creature"]},"optional":true,"except":{"abilities":[{"kind":"triggered","trigger":{"event":"upkeep","by":"you","condition":{"kind":"not","condition":{"kind":"sourceIs","state":"token"}}},"effects":[{"effect":"createTokenCopy","target":{"of":"object","mode":"self"}}]}]}}` - `toGraveyard` — Self Shuffle: “If this creature would be put into a graveyard from anywhere, shuffle it into its owner's library instead.” → `{"replaces":"toGraveyard","instead":"shuffleIntoLibrary"}` - `entersDesignated` — Vastlands Scavenger: “This creature enters prepared.” → `{"replaces":"entersDesignated","designation":"prepared"}` - `event` — Iter99 Draw Doubler: “” → `{"replaces":"event","event":"draw","toPlayer":"you","multiply":2}`