# Drawstep engine · Triggers · `searchesLibrary` > Searches library — Whenever a player searches a library, even if nothing is found (CR 701.23; `ownLibrary`: their own). 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/triggers#searchesLibrary ## Where it goes The `trigger` of a triggered ability: `{ "kind": "triggered", "trigger": { "event": "searchesLibrary", … }, "effects": [ … ] }`. The common trigger fields (`filter`, `by`, `other`, `condition`, `damageKind`, `oneOrMore` …) are on the triggers page. ## Fields No fields besides the discriminator. ## Stock examples - **Archivist of Oghma** — “Whenever an opponent searches their library, you gain 1 life and draw a card.” ```json {"event":"searchesLibrary","by":"opponent","ownLibrary":true} ``` - **Ob Nixilis, Unshackled** — “Whenever an opponent searches their library, that player sacrifices a creature of their choice and loses 10 life.” ```json {"event":"searchesLibrary","by":"opponent","ownLibrary":true} ``` ## Related - [Triggers](https://drawstep.xyz/wiki/mtg/triggers.md) — the whole topic - [Start here](https://drawstep.xyz/wiki/mtg/start.md) — the rules, the output contract and the index of every primitive