> For the complete documentation index, see [llms.txt](https://enchantedmobs.superiormc.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://enchantedmobs.superiormc.cn/for-ultimatequest/configuration/rewards/random.md).

# Random Rewards

A random entry selects weighted reward groups and grants every reward in each selected group. Use inline random or external pool, never both.

| Field                       | Default              | Description                                                   |
| --------------------------- | -------------------- | ------------------------------------------------------------- |
| type                        | Required             | random.                                                       |
| count                       | 1                    | Positive integer draw count.                                  |
| repeat                      | false                | Whether the same choice can be selected again in this draw.   |
| random                      | Required unless pool | Named weighted choices.                                       |
| random..rate                | 0                    | Finite nonnegative weight; total must be finite and positive. |
| random..rewards             | Required             | Nonempty full reward mapping for the selected group.          |
| display.name / display.lore | Generated            | Optional preview override.                                    |

```yaml
rewards:
  supply:
    type: random
    count: 2
    repeat: false
    random:
      food:
        rate: 70
        rewards:
          bread:
            type: item
            item: {material: BREAD, amount: 8}
      mineral:
        rate: 25
        rewards:
          iron:
            type: item
            item: {material: IRON_INGOT, amount: 4}
      treasure:
        rate: 5
        rewards:
          diamond:
            type: item
            item: {material: DIAMOND, amount: 1}
```

## Weight and repeat semantics

Weights are relative and need not add to 100. Zero-weight choices are excluded. Without replacement, each selected group leaves the candidate set; count cannot exceed positive-weight choices. With repeat true, it remains available and can grant again. Identical nested reward names from different groups/draws are preserved independently.

Single draws can preview probabilities; multiple draws preview weights because first-draw probability is not final inclusion probability. Nested random rewards are supported up to 8 random levels. Invalid counts/types/weights or references reject loading through ErrorManager.

## Draw timing

Normal acceptance and periodic instance creation draw immediately. A scroll stores its objective/reward definition at issuance and draws when first activation creates its instance. Stage rewards draw on unlock. Persisted rewards-snapshot/stage snapshots retain outcomes across reloads/reconnects. This differs from [random actions](/for-ultimatequest/configuration/actions/orchestration.md), which roll when executed.
