forked from Greymerk/minecraft-roguelike
-
Notifications
You must be signed in to change notification settings - Fork 9
Weighted Entry
fnar edited this page Dec 29, 2021
·
4 revisions
A Weighted Entry wraps another item and adds a weight to it.
The shape of the data depends on what the item being weighted is, for example Loot Rules contain weighted Loot Items.
- {object}
- "weight": optional integer (defaults to 1) representing the relative weight this choice will be selected in a roll.
- "data": Represents the contents of this entry. Can be either an object or an array of objects.
- {object}: The properties of this weighted element; usually depends on the context. In the context of loot, this often means which item
- "type": The type of loot contained in this entry.
- [array] (of Weighted Entries): A list of objects like the parent object.
- {object}: The properties of this weighted element; usually depends on the context. In the context of loot, this often means which item
{"weight": 1, "data": {"name": "minecraft:wheat"}}
Weighted entries can contain further elements of like type if their "data"
element is an array.
{
"weight": 1,
"data": [
{"weight": 1, "data": {"name": "minecraft:carrot"}}
{"weight": 1, "data": {"name": "minecraft:bread"}}
]
}