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

helix / LootTableDef

Class: LootTableDef โ€‹

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

A loot table, registered with Datapack.lootTable. Item entries use the same items you give.

dp.lootTable("chests/reward", new LootTableDef("chest").pool( new LootPool().rolls(1).item(Item.DIAMOND.count(3))));

Constructors โ€‹

Constructor โ€‹

new LootTableDef(type?): LootTableDef

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

Parameters โ€‹

type? โ€‹

string

loot context type (chest, block, entity...). Omit for an untyped table.

Returns โ€‹

LootTableDef

Properties โ€‹

functionsList โ€‹

readonly functionsList: LootFunction[] = []

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


pools โ€‹

readonly pools: LootPool[] = []

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


type? โ€‹

readonly optional type?: string

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

loot context type (chest, block, entity...). Omit for an untyped table.

Methods โ€‹

func() โ€‹

func(fn): this

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

A function applied to the whole table's output.

Parameters โ€‹

fn โ€‹

LootFunction

Returns โ€‹

this


pool() โ€‹

pool(pool): this

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

Add a pool (build it with LootPool).

Parameters โ€‹

pool โ€‹

LootPool

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.