Understanding Loot and Loot Tables
Explaining loot and loot tables
Introduction
With 2.0.0 comes a huge expansion on the rewards system. Not only can you give rewards and have multipliers like usual, but you may now have items, commands, potion effects, and even custom items as loot. Let's take a look at how loot tables are structured and made.
Loot Table
Here's a bit of the default loot table money_table that is generated with a fresh install of the plugin.
If you are experienced with Economobs it may seem familiar. Loot now has way more options for you to use and make your servers unique. Here is the breakdown and available options.
Weight is a piece of distribution. When the plugin rolls and picks an outcome, it uses "total weight" - adding all the reward weights together. For example: A reward with a weight of 20 in a total weight of 200, means it will have a 10% chance of dropping said reward. These weight values do not need to be within a 100 total weight. Use this weight system to your advantage. When no weight is defined, it will assume 100 weight. When the total is under 100, this allows rewards to not be given.
TABLE_NAME - name of the loot table. These must be unique across your tables; you will be using this name to assign your mobs loot tables.
LOOT_ID - id of the loot inside the table, these must be unique within the table. TYPE is the type of loot. This can be ECONOMY, ITEM, CUSTOM_ITEM, POTION, or COMMAND
FROM - where the loot is sourced from. When it comes to economy, this should be an Economy hook. When it comes to custom items, it should be a custom item hook.
MIN and MAX - the ranges of the amount the loot will distribute.
MESSAGE - sets a custom message for the loot. If not defined, the plugin will use the message in language.yml.
Examples
Basic economy reward that will come from your server's main economy.
Item reward that drops an enchanted, named pickaxe.
Custom item reward that drops ruby shards from the plugin ItemsAdder.
Potion effect reward that gives you Speed 2.
A reward that runs a command.
Last updated