If a card in a player's library has X in its mana cost, X is considered to be 0.

Artwork
Loading artwork…
Treasure Keeper
Foundations Jumpstart · #760 · EN
Nonfoil—Foil—
Card rules
When this creature dies, reveal cards from the top of your library until you reveal a nonland card with mana value 3 or less. You may cast that card without paying its mana cost. Put all revealed cards not cast this way on the bottom of your library in a random order.
3/3
Uncommon · Illustrated by James Paick
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
Pioneer Legal
Timeless Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
If a spell has X in its mana cost, you must choose 0 as the value of X when casting it without paying its mana cost.
If you don't cast the nonland card with mana value 3 or less, it'll be put on the bottom of your library in a random order with the other cards.
If your library has no nonland cards in it with mana value 3 or less, you'll reveal all the cards in your library, then put them back in a random order.
If you cast a spell "without paying its mana cost," you can't choose to cast it for any alternative costs. You can, however, pay additional costs. If the card has any mandatory additional costs, those must be paid to cast the spell.