Skip to content

Loot Tables

Slashscreen edited this page Mar 28, 2024 · 1 revision

Skelerealms provides a loot table system that should cover most use cases. It is composed of a series of LootTableItems, which in turn may also contain other loot tables. There are several kinds of loot table items, as it is a base class, each performing different actions. All of these items are taken into account when the loot table is "resolved", meaning everything is calculated and a list of generated ItemDatas, as well as currencies, are returned. The loot table is thusly structured as a nested series of probabilities, based vaguely off of Minecraft's loot table system.

Here are the built-in Loot Table Items:

  • Item Entry: Contains a single item to be added to the parent loot table.
  • Loot Table Currency: Adds a currency to the parent loot table, between the min and max. If max is left at 0, it will always return the minimum amount.
  • On Condition: When the loot table is resolved, the script within will be executed. If the script returns true, the enclosed loot table will be resolved and added to the parent loot table.
  • X Of Items: A random number of items from the enclosed loot table will be added to the parent; between min and max. Like with currency, if the max is left at 0, it will always select the minimum number of items.
  • Item Chance: The item will be added to the parent if a random roll succeeds. The chance is from 0 to 1, 1 meaning it will always be added to the parent.

Like some other things, there is a built-in editor tool provided. Click the little button at the top of the inspector.

Clone this wiki locally