Skip to main content

Lottery pool

Registry: system:lottery_pools. Each confirmation draws one complete prize package; the server samples by integer weight, and the model does not choose the prize.

FieldTypeRequiredDefaultDescription
labelText componentnoEmpty componentMust be non-empty when enabled.
costsSaturn cost arrayno[]An empty list means a free draw.
entriesPrize entry arrayno[]At least one entry when enabled.
enabledBooleannotrueCan be disabled by an override.

Prize entries​

FieldTypeRequiredDefaultDescription
rewardReward snapshot objectyes—Contains id, label and items; it is not a string reference to another reward table.
weightPositive integerno1Probability is this entry's weight / the sum of all weights.
reward.idResource IDyes—Identifier of the prize snapshot.
reward.labelText componentyes—Prize name.
reward.itemsItem stack template arrayyes—1–36 items.

Example​

data/example/system/lottery_pools/supplies.json
{
"label": {
"text": "Daily supplies"
},
"costs": [
{
"type": "saturn:item",
"items": [
"minecraft:emerald"
],
"amount": 2
}
],
"entries": [
{
"weight": 3,
"reward": {
"id": "example:food",
"label": {
"text": "Rations"
},
"items": [
{
"id": "minecraft:bread",
"count": 8
}
]
}
},
{
"weight": 1,
"reward": {
"id": "example:diamond",
"label": {
"text": "Diamond"
},
"items": [
{
"id": "minecraft:diamond"
}
]
}
}
]
}

The two prizes have probabilities of 75% and 25% respectively. Add them to the values of data/system/tags/system/lottery_pools/default.json, or select them through the pools of the lottery module. Empty costs allow repeated free draws, so design the cost according to your gameplay; the entries and the contents of prize packages are not decided by the client.