Skip to content

Keyword reference ​

Every keyword and symbol in .mtgr, grouped by where it appears, with an example. This page is a quick reference. The specification is authoritative, and the section numbers below point into it.

Symbols ​

SymbolMeaningExampleSpec
[Name "value"]A tag.[Perspective "PlayerA"]4
M:SSTime since the game started, at the start of every body line.1:525.1
-The time of a line inside a variation.- (12
#NAn instance ID.#26.1
#hNA hypothetical ID, inside a variation only.#h112
"..."A string: a name, a player, or text. \", \\, and \n are escapes."Ugin's Labyrinth"2
{W} {U} {B} {R} {G} {C}One mana of a type.{G}{C}{C}9.4
->From one zone or value to another.move hand -> exile, life 20 -> 197.1, 9.5
?Unknown.by ?8
$NA Numeric Annotation Glyph, 0 to 255. $1 good, $2 poor, $3 very good, $4 very poor, $5 speculative, $6 questionable.$211
{...}A comment, after the statement.{should have held up mana}11
;A comment to the end of the line.; misclick11
%In the first column: an escape line that parsers ignore.%debug 12343
( )A variation: an alternative to the line before it.- (12
1-0 0-1 1/2-1/2 *The result line that ends each game.1-03

Structure ​

KeywordMeaningExampleSpec
deckThe perspective player's decklist for this game.deck "PlayerA" name "Mono Green"10.5
main, sideA decklist entry in the main deck or sideboard.main 4 "Ugin's Labyrinth"10.5
unknownThe decklist is not known.deck "PlayerA" unknown10.5
pregameEverything before turn 1: die rolls, opening hands, mulligans.pregame9.1
turnA turn, with its active player.turn 5 "PlayerA"9.2
keyframeThe full game state at the start of the pregame or a turn.keyframe10
playerIn a keyframe: a player's life, poison, library size, and clock.player "PlayerA" life 20 poison 0 library 5310.2
round-clockIn a keyframe: round time left.round-clock 31:2010.4
stackUnder a priority line: the whole stack, top first.stack9.9
incompleteEvents may be missing from here to the next keyframe. Turns after it may be missing.incomplete "source disconnected"9.8, 5.3
day, nightThe game becomes day or night; in a keyframe, the game is day or night.night by rule:day-night9.10
game-drawThe game is a draw.game-draw by rule:sba9.7

Steps and phases ​

Written in this order, one line each when they occur (spec 9.2):

KeywordStep or phaseCR
untapuntap step502
upkeepupkeep step503
drawdraw step504
precombat-mainprecombat main phase505
beginning-of-combatbeginning of combat step507
declare-attackersdeclare attackers step508
declare-blockersdeclare blockers step509
combat-damagecombat damage step510
end-of-combatend of combat step511
postcombat-mainpostcombat main phase505
endend step513
cleanupcleanup step514

Introducing objects ​

KeywordMeaningExampleSpec
new cardA card whose name is known.new card #7 "Ugin's Labyrinth" owner "PlayerA" in library6.5
new hiddenA card whose name is hidden from the perspective player.new hidden #24 owner "PlayerB" in library6.5
new tokenA token, optionally tapped and attacking.new token #62 "Angel" owner "PlayerA" in battlefield tapped attacking "PlayerB" by #616.5
new copyA copy of a card or spell, or (with controller) of an ability. It has the original's choices.new copy #102 of #98 controller "PlayerA" in stack by #1016.5
new abilityAn ability. With in stack, it is put on the stack; a mana ability has no zone. from #N names the effect a delayed trigger came from.new ability #33 triggered of #2 "Sowing Mycospawn" "When you cast ..." controller "PlayerA" in stack6.5
new effectA lasting effect: a delayed trigger, or an effect lasting past this turn.new effect #15 of #1 "Tamiyo, ..." "Until your next turn, ..." controller "PlayerA" by #149.10
new emblemAn emblem in the command zone.new emblem #171 "You have no maximum hand size." owner "PlayerA" by #1709.10
top N, bottom NOn new ... in library: which card it is.new hidden #38 owner "PlayerB" in library top 16.5
activated triggered loyalty manaThe kind of ability.new ability #29 mana of #7 ...6.5
ofThe source of an ability or the original of a copy.of #7 "Ugin's Labyrinth"6.5
ownerThe object's owner.owner "PlayerA"6.5
controllerAn ability's or stack entry's controller.controller "PlayerB"6.5, 9.9
inThe zone an object is introduced in.in library6.5
printA printing: set code and collector number.print "MH3" "233"6.4
srcA source's own ID for the card.src mtgo:1264856.4
identifyNames a hidden object.#16 identify "Island"6.6

Zones ​

KeywordZone
library hand graveyardA player's library, hand, or graveyard.
battlefield stack exile command anteThe shared zones.
outside "label"Outside the game (not a zone), for example outside "sideboard".

Object events ​

All start with an object: #2 "Sowing Mycospawn" cast from hand.

KeywordMeaningExampleSpec
play fromPlays a land, with tapped if it enters tapped.#1 "Watery Grave" play from hand tapped7.1
cast fromCasts a spell: it moves to the stack. Caused by ID only when cast while that spell or ability resolves (cascade, suspend).#54 "Living End" cast from exile by #517.1
faceWhich face or half is cast, played, entering, or up.#80 "Fire // Ice" cast from hand face "Ice"7.1
fusedBoth halves of a split card with fuse are cast.#70 "Wear // Tear" cast from hand fused7.1
moveMoves between zones.#17 "Urza's Tower" move battlefield -> exile by #347.1
asThe keyword action behind a move: draw, discard, sacrifice, destroy, mill.move library -> hand as draw by rule:draw7.1
top, bottomPosition in a library.move hand -> library bottom by rule:mulligan7.1
tappedEnters the battlefield tapped.move library -> battlefield tapped by #337.1
ptThe power and toughness a creature enters with.move stack -> battlefield pt 2/1 by rule:resolve7.1
attackingEnters the battlefield attacking (it never "attacked").move hand -> battlefield tapped attacking "PlayerB" by #717.1
withExiled with an object, for linked abilities. The link ends when either object changes zone, except a permanent spell becoming a permanent (CR 607.2q).move hand -> exile with #7 by #227.1
chooseA choice: see below.#2 "Sowing Mycospawn" choose cost "kicker"7.2
targetA target, with amount when divided.#34 target #17 "Urza's Tower"7.2
tap, untapTaps or untaps.#7 "Ugin's Labyrinth" tap by cost:#297.3
attach, unattachAttaches to or unattaches from an object.#3 "Utopia Sprawl" attach #36 "Stomping Ground" by rule:resolve7.3
controlChanges controller.#40 "Island" control "PlayerA" by #397.3
countersCounters of a kind change.#50 "Walking Ballista" counters "+1/+1" 0 -> 2 by #507.3
ptPower and toughness change; none for a noncreature.#10 "Ragavan, Nimble Pilferer" pt 2/1 -> 1/1 by #207.5
costAn effect changes the mana cost of a spell or ability.#2 "Thoughtseize" cost {1}{B} -> {2}{B} by #317.6
damageDeals damage; prevented if it was completely prevented.#1 "Talisman of Impulse" damage "PlayerA" 1 by #317.3
attackDeclared as an attacker. Followed by tap by rule:declare-attackers unless it has vigilance.#2 "Sowing Mycospawn" attack "PlayerB"7.3
blockDeclared as a blocker.#45 block #2 "Sowing Mycospawn"7.3
revealRevealed (a game action).#30 "Island" reveal by #297.3
lookA player looks at the card.#87 "Consider" look "PlayerA" by #867.3
transformA double-faced permanent turns over.#66 "Delver of Secrets // Insectile Aberration" transform by #867.3
become-copyBecomes a copy of another object, taking its name.#90 "Phantasmal Image" become-copy #3 "Ragavan, Nimble Pilferer" by #907.3
specialA special action: companion, suspend, or plot.#125 "Crashing Footfalls" special suspend7.3
goad, end-goadBecomes goaded; stops being goaded by a player.#150 "Grizzly Bears" goad by #1497.3
untrackedCan no longer be told apart; its ID ends.#15 untracked7.3
ceaseCeases to exist (abilities, tokens, copies, effects); its ID ends.#34 cease by rule:resolve7.3
resolveBegins to resolve.#34 resolve7.4
fizzleDoes not resolve: every target is illegal, optionally with what made them illegal.#2 "Thoughtseize" fizzle by #97.4
counteredIs countered.#2 "Sowing Mycospawn" countered by #467.4

Choices ​

KeywordThe choiceExample
choose modeA mode, as text.choose mode "Return target nonland permanent to its owner's hand."
choose costAn additional or alternative cost, by name, one line per payment. A free cast is "without paying its mana cost".choose cost "kicker"
choose xThe value of X.choose x 3
choose symbolHow a hybrid or Phyrexian symbol is paid: a symbol, or life.choose symbol {B/P} life
choose colorwhite, blue, black, red, or green.choose color red
choose optionA choice offered in words.choose option "pay 2 life"
choose objectAn object, without targeting.choose object #5 "Emrakul, the Exigent Doom"
choose playerA player, without targeting.choose player "PlayerB"
choose numberA number.choose number 2
choose nameA card name.choose name "Urza's Tower"
choose typeA card type or other characteristic.choose type "Artifact"
choose hiddenA choice whose value is hidden.choose hidden

A choice is made by the object's controller unless the line ends with by "Player": #51 choose option "do not discard" by "PlayerB". choose object is not targeting, so hexproof and ward don't apply to it; target is.

Player events ​

All start with a player: "PlayerA" pass.

KeywordMeaningExampleSpec
rollRolls a die, optionally with its size."PlayerA" roll d20 159.1
choose firstChooses who takes the first turn."PlayerA" choose first "PlayerA"9.1
chooseA choice belonging to no spell or ability, with a rule cause."PlayerA" choose object #3 "Ragavan, Nimble Pilferer" by rule:sba7.2
mulliganDeclares a mulligan."PlayerB" mulligan9.1
keepKeeps their hand."PlayerA" keep9.1
priorityReceives priority, optionally with both clocks."PlayerB" priority clock "PlayerA" 21:04 "PlayerB" 19:519.3
passPasses priority."PlayerB" pass9.3
addMana is added to their pool, with any restriction."PlayerA" add {C}{C} by #299.4
paySpends mana from their pool."PlayerA" pay {G}{C}{C}{C}{C}{C} by cost:#29.4
lose-manaLoses unspent mana as the pool empties."PlayerB" lose-mana {C} by rule:empty-pool9.4
lifeLife total changes."PlayerA" life 19 -> 17 by #369.5
poisonPoison counters change."PlayerB" poison 3 -> 5 by #419.5
countersOther player counters change."PlayerA" counters "energy" 0 -> 2 by #129.5
searchSearches a zone, optionally another player's."PlayerA" search library "PlayerB" by #1459.6
shuffleTheir library is shuffled."PlayerA" shuffle by #339.6
concedeConcedes."PlayerB" concede9.7
lose, winLoses or wins the game."PlayerB" lose by rule:sba9.7

Keyframe entries ​

KeywordMeaningExampleSpec
tappedThe permanent is tapped.#7 "Ugin's Labyrinth" battlefield "PlayerA" tapped10.3
faceThe face that is up.#66 "Delver of Secrets // Insectile Aberration" battlefield "PlayerA" face "Insectile Aberration"10.3
ptA creature's current power and toughness.#3 "Ragavan, Nimble Pilferer" battlefield "PlayerB" pt 2/110.3
adventureThe card is in exile on an adventure, and the player who may play it.#82 "Bonecrusher Giant // Stomp" exile adventure "PlayerA"10.3
companionA revealed companion, still outside the game.#1 "Lurrus of the Dream-Den" outside "sideboard" "PlayerA" companion10.3
goadedGoaded by that player.#150 "Grizzly Bears" battlefield "PlayerB" goaded "PlayerA"10.3
emblemAn emblem's text.#171 command "PlayerA" emblem "You have no maximum hand size."10.3
effectA lasting effect still in force.#15 effect of #1 "Tamiyo, ..." "..." controller "PlayerA"10.3
attachedAttached to an object.#3 "Utopia Sprawl" battlefield "PlayerA" attached #3610.3
withExiled with an object.#5 "Emrakul, the Exigent Doom" exile with #710.3
countersCounters on the object.counters "+1/+1" 210.3
top N, bottom NPosition in a library, 1 being the end card.#15 library "PlayerB" bottom 110.3
clockTime left on the player's clock.player "PlayerA" life 17 poison 0 library 51 clock 21:0410.2

Causes ​

Every cause starts with by (spec 8).

CauseMeaningExample
by #NThe effect of an object.by #34
by cost:#NPaying a cost of a spell or ability.by cost:#2
by "Player"The player's own action; on a choice line, who chose.by "PlayerB"
by rule:opening-handDrawing the opening hand (CR 103.5).
by rule:mulliganA mulligan (CR 103.5).
by rule:untapThe untap step (CR 502.3).
by rule:drawThe draw step's draw (CR 504.1).
by rule:combat-damageCombat damage (CR 510.2).
by rule:cleanupCleanup step actions (CR 514.1, 514.2).
by rule:sbaA state-based action (CR 704.3).
by rule:empty-poolThe mana pool emptying (CR 106.4).
by rule:resolveLeaving the stack after resolving, or an Aura attaching as it resolves (CR 608.2n, 608.3a, 608.3c).
by rule:fizzleLeaving the stack with illegal targets (CR 608.2b).
by rule:no-choiceA trigger removed with no legal choice or no mode (CR 603.3d, 700.2b).
by rule:intervening-ifA trigger whose "if" is false as it resolves (CR 608.2a).
by rule:declare-attackersAttackers becoming tapped (CR 508.1f).
by rule:loreSaga lore counters (CR 703.4f).
by rule:replacement-orderChoosing which replacement effect applies (CR 616.1).
by rule:durationAn effect's duration ending (CR 611.2a).
by rule:delayed-triggerA once-only delayed trigger having triggered (CR 603.7b).
by rule:day-nightDay or night changing in the untap step (CR 731.2).
by source:clockA player's clock ran out.
by source:disconnectA player disconnected.
by ?Unknown.

After a cause, replacement #N names a replacement effect that changed the event: #10 "Ragavan, Nimble Pilferer" move hand -> exile as discard by #18 replacement #15 (Leyline of the Void exiles a discarded card instead of putting it into the graveyard).