Alpha: this compiler is under active development and updates will break your projects. Not recommended for real use yet.
Skip to content

helix / LootPool

Class: LootPool โ€‹

Defined in: core/values/loot-table.ts:22

Fluent loot pool: how many rolls, which entries, and pool-wide functions.

Constructors โ€‹

Constructor โ€‹

new LootPool(): LootPool

Returns โ€‹

LootPool

Properties โ€‹

entriesList โ€‹

readonly entriesList: LootEntry[] = []

Defined in: core/values/loot-table.ts:24


functionsList โ€‹

readonly functionsList: LootFunction[] = []

Defined in: core/values/loot-table.ts:25


rollsValue โ€‹

rollsValue: NumberProvider = 1

Defined in: core/values/loot-table.ts:23

Methods โ€‹

empty() โ€‹

empty(weight?): this

Defined in: core/values/loot-table.ts:50

Add an empty (nothing) entry with weight.

Parameters โ€‹

weight? โ€‹

number

Returns โ€‹

this


func() โ€‹

func(fn): this

Defined in: core/values/loot-table.ts:56

A function applied to every entry rolled from this pool.

Parameters โ€‹

fn โ€‹

LootFunction

Returns โ€‹

this


item() โ€‹

item(item, opts?): this

Defined in: core/values/loot-table.ts:37

Add a minecraft:item entry. Adds set_count / set_components from the item automatically, before any opts.functions.

Parameters โ€‹

item โ€‹

ItemLike

opts? โ€‹

EntryOpts

Returns โ€‹

this


lootTable() โ€‹

lootTable(ref, opts?): this

Defined in: core/values/loot-table.ts:43

Add a nested-loot-table entry.

Parameters โ€‹

ref โ€‹

string | LootTableRef

opts? โ€‹

EntryOpts

Returns โ€‹

this


rolls() โ€‹

rolls(n): this

Defined in: core/values/loot-table.ts:28

Number of times this pool is rolled (exact or a {min,max} range).

Parameters โ€‹

n โ€‹

NumberProvider

Returns โ€‹

this

Released under the MIT License ยท Credits
These docs were written with AI; the layout and every page have been reviewed by a human.