# Drawstep engine · Values · `playerAggregate` > Player aggregate — CR 107.1, 608.2h: greatest/least value among players (default eachPlayer). Bind current separately for each player without rebinding you; empty set yields zero. 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/values#playerAggregate ## Where it goes A number: `{ "kind": "playerAggregate", … }` wherever a ValueDef is accepted (`amount`, `power`, `max`, `count` …); a plain integer is also a ValueDef. ## Fields | Field | Type | Required | Description | |---|---|---|---| | `op` | `"max" \| "min"` | yes | Comparison or arithmetic operator | | `players` | `"you" \| "controller" \| "abilityController" \| "sourceController" \| "owner" \| "eachOpponent" \| "eachPlayer" \| "target" \| "triggeringPlayer" \| "defendingPlayer" \| "attackingPlayer" \| "activePlayer" \| "re …` | no | Which players are compared (default each player); the value is evaluated as each of them in turn | | `value` | `ValueDef` | yes | The value to store or compare | ## Minimal form ```json {"kind":"playerAggregate","op":"max","value":1} ``` The engine reads that minimal form as: “the greatest value of 1 among each player”. ## Stock examples - **Least Discard Study** — “” ```json {"kind":"playerAggregate","op":"min","value":{"kind":"doneThisWay","of":"discarded","filter":{"owner":"current"}}} ``` - **Windfall** — “Each player discards their hand, then draws cards equal to the greatest number of cards a player discarded this way.” ```json {"kind":"playerAggregate","op":"max","value":{"kind":"doneThisWay","of":"discarded","filter":{"owner":"current"}}} ``` ## Related - [Values](https://drawstep.xyz/wiki/mtg/values.md) — the whole topic - [Values](https://drawstep.xyz/wiki/mtg/values.md) — every number kind an `amount` accepts - [Start here](https://drawstep.xyz/wiki/mtg/start.md) — the rules, the output contract and the index of every primitive