CustomLootable

Simple weighted loot tables: lists of items each with an independent spawn chance.

Types

Link copied to clipboard
data class ItemCellData(val item: ItemStack, val chanceSpawn: Double)

One loot entry: an item and its independent chanceSpawn in 0.0..1.0.

Functions

Link copied to clipboard

Registers a loot table for later reference.

Link copied to clipboard
fun putLootToContainer(container: Container, lootTable: ArrayList<CustomLootable.ItemCellData>)

Rolls lootTable and places the winning items into random free slots of container.

Link copied to clipboard
fun spawnLootAtLocation(location: Location, lootTable: ArrayList<CustomLootable.ItemCellData>)

Rolls lootTable and drops the winning items naturally at location.