Loot Pools & Weights¶
LorefulLoot supports two types of item allocation for your spawned entities: Guaranteed and Weighted.
This is controlled by the minLootRolls and maxLootRolls parameters in your GenerationRule.
Weighted Roll System¶
If you define minLootRolls and maxLootRolls (e.g., min: 2, max: 5), the mod uses an RPG-style weighted pool.
- It picks a random number of "rolls" between your min and max.
- For every roll, it adds up the
weightof all items in thelootarray. - It picks a random number up to that total weight and selects the winning item.
- It randomizes the stack size of that winning item between its
minCountandmaxCount.
Example¶
"minLootRolls": 2,
"maxLootRolls": 4,
"loot": [
{
"itemName": "SHIP_CORE",
"minCount": 1,
"maxCount": 1,
"weight": 10
}
]
Guaranteed System (No Rolls)¶
If you omit minLootRolls and maxLootRolls (or leave them at -1), the mod will spawn EVERY item defined in the loot array.
It will still respect the minCount and maxCount constraints to randomize the stack sizes, but the weight property is ignored.
LootRule Properties¶
| Property | Type | Default | Description |
|---|---|---|---|
itemName |
String | (Required) | The internal ID name of the StarMade item (e.g. STEAK, SHIP_CORE). Ignored for logbooks and weapons — see text and subtype. |
minCount |
Integer | 1 |
The minimum amount of this item to spawn in a single stack. |
maxCount |
Integer | 1 |
The maximum amount of this item to spawn in a single stack. |
count |
Integer | -1 |
Hard override. If set, ignores min/max and spawns exactly this amount. |
weight |
Integer | 1 |
The relative chance of this item being picked during a weighted loot roll. |
text |
String | null |
If set, spawns a Logbook meta-item with this string as its contents. Overrides itemName. |
subtype |
String | null |
If set, spawns a Weapon meta-item of this subtype (e.g. PISTOL). Overrides itemName. Takes precedence over itemName but is overridden by text. |
Meta-Item Examples¶
Logbook — spawns a readable logbook with custom lore text:
{
"text": "Day 47. The engines are dead and we're drifting. If anyone finds this...",
"weight": 5
}
Weapon — spawns a weapon of the specified subtype:
{
"subtype": "PISTOL",
"count": 1,
"weight": 8
}