Rewards & reward tables
A reward is an object with a type field. Scripta 1.0.0 ships
eleven types — ten that grant something, plus an explicit no-op
placeholder for padding weighted tables.
Reward types
Quick reference. Every field not marked optional is required.
| Type | Fields | What happens |
|---|---|---|
item |
item (req)amount = 1 |
Gives items. Overflow that does not fit in your inventory is dropped at your feet, never voided. Valid range 1–9999. |
xp |
amount = 1 |
Gives XP points. Range 1–1000000. |
xp_levels |
levels = 1 |
Gives XP levels directly. Range 1–1000. |
command |
command (req) |
Runs a console command with you as the source — so
/say, /give and
/effect all work. Max 1024 characters.
|
advancement |
id (req) |
Awards the advancement, satisfying every criterion. |
toast |
message (req) |
Shows a client-side toast notification. Max 100 characters. |
choice |
options = []table = ""count = 1
|
Interactive. The player picks from a picker screen. Never granted automatically. |
random |
table (req) |
Rolls one entry from a weighted reward table. |
all_table |
table (req) |
Grants every entry in a table. Weights ignored. |
loot_crate |
table (req) |
Gives a physical Loot Crate item. The player right-clicks it to roll. Table must be crate-enabled. |
empty |
— | Grants nothing. Exists so a table can have a "no prize" chance. |
experience is a legacy alias
Old files using {"type": "experience", "amount": 5} still
load — they are treated as xp.
Examples
"rewards": [
{ "type": "item", "item": "minecraft:diamond", "amount": 3 },
{ "type": "xp", "amount": 100 },
{ "type": "xp_levels", "levels": 2 },
{ "type": "command", "command": "give @s minecraft:diamond 1" },
{ "type": "advancement", "id": "minecraft:story/root" },
{ "type": "toast", "message": "Well done, adventurer!" }
]Weighted reward tables
A reward table is a weighted pool. Reference it from a
random, all_table, loot_crate or
choice reward by its id.
| Field | Type | Required | Default |
|---|---|---|---|
id | string | Yes | — |
name | string | No | "" (falls back to id) |
entries | array | No | [] |
entries[].reward | reward | Yes | — |
entries[].weight | double | No | 1.0 |
crate.enabled | bool | No | true if crate is present, else false |
crate.name | string | No | "" |
{
"id": "starter_loot",
"name": "Starter Loot",
"entries": [
{ "reward": { "type": "item", "item": "minecraft:bread", "amount": 3 }, "weight": 40 },
{ "reward": { "type": "item", "item": "minecraft:iron_ingot", "amount": 1 }, "weight": 25 },
{ "reward": { "type": "item", "item": "minecraft:diamond", "amount": 1 }, "weight": 5 },
{ "reward": { "type": "empty" }, "weight": 30 }
],
"crate": { "enabled": true, "name": "Starter Crate" }
}How weights work
Weights are relative probabilities, not percentages, and do not have to total 100. In the table above the four entries have weights 40 / 25 / 5 / 30, totalling 100, so they roll at 40% / 25% / 5% / 30%. Double every weight and the odds stay identical.
- Entries with
weight <= 0are excluded from the draw entirely. - If no entry has a positive weight, the roll finds nothing.
emptyentries are the idiomatic way to add a "you got nothing" chance.
data/ folders and /reload will not pick up
a hand-written table file. They live in the editor store — see
Files & storage. Create them in the
web or in-game editor.
Loot crates
A loot_crate reward gives the player a real
Loot Crate item instead of rolling immediately. Which table it
holds is stored on the item itself.
- Enable
crateon the table you want to hand out. - Give the crate via
{ "type": "loot_crate", "table": "<id>" }. - The player right-clicks the crate to roll it once.
{ "type": "loot_crate", "table": "starter_loot" }- Crates stack to 64.
- The roll happens server-side when the player opens it.
- Each open consumes one crate, unless the player is in creative mode.
- A crate whose table has gone missing or is invalid is not consumed.
name field (falling
back to its id). The crate.name field is stored
but not used for messages.
Choice rewards in depth
A choice reward is the one interactive type: it is never
auto-granted, even when auto_claim is true. The
player opens a picker and selects an option (or several, up to
count).
Inline options
{
"type": "choice",
"count": 1,
"options": [
{ "type": "item", "item": "minecraft:golden_apple", "amount": 1 },
{ "type": "item", "item": "minecraft:diamond", "amount": 2 }
]
}From a table
Point table at a reward table instead and its entries become
the options. empty entries are filtered out, and weights are
ignored — the player chooses deliberately rather than gambling.
{ "type": "choice", "table": "starter_loot", "count": 2 }choice reward cannot live inside a reward table. The editor
refuses to save it and the in-game claim path reports
“A choice reward inside a table must be claimed from a quest
directly.” Put choices on quests.
Reward presets
Presets are reusable reward bundles you can insert into any quest with one click. Three ship built in and cannot be deleted or overwritten:
| Preset | Contents |
|---|---|
| Starter Kit | 5 bread, 5 XP |
| Monster Hunter | 10 XP, 2 iron ingots |
| Treasure | 1 golden apple, give @s minecraft:diamond 1 |
Your own presets are managed in the Reward presets panel of either editor. Names must be 1–48 characters and cannot reuse a built-in name.
Validation rules
Editors validate rewards before saving and reject out-of-range values rather than letting them reach the game. Key limits:
| Rule | Limit |
|---|---|
| Item amount | 1–9999 |
| XP amount | 1–1000000 |
| XP levels | 1–1000 |
| Command length | 1–1024 characters |
| Toast length | 1–100 characters |
| Choice options | At least 2 inline options, or a table with entries |
| Choice count | 1–64 |
| Reward nesting depth | Max 3 in tables |
A loot_crate reward must point at a table with
crate.enabled set to true, otherwise it is
rejected.
Unknown & legacy rewards
Scripta is deliberately tolerant so a quest written for a newer version does not break an older server:
- An unrecognised
typeis preserved verbatim and displayed as Unknown reward rather than failing the quest. - One bad entry in a rewards array is skipped; the rest of the quest still loads.
- The
experiencetype is rewritten toxp. - Definitions round-trip cleanly, so unknown rewards survive a reload.