Skip to content

Loot Tables

totemo edited this page Feb 13, 2020 · 46 revisions

Start: Home ⬩ Previous: Mobs ⬩ Next: Zones


BeastMaster uses loot tables to randomly select an item or a mob. There are no pre-defined loot tables; you create them yourself using /beast-loot add. As with all BeastMaster commands, /beast-loot help will describe all of the available options of the /beast-loot command.


The properties of a mob can be configured to specify loot tables that randomly select items to be:

  • dropped when a mob dies,
    e.g. /beast-mob set creeper drops creeper-drops,
  • worn by a mob as armour or held as weapon,
    e.g. /beast-mob set zombie main-hand zombie-weapons-table,
  • ridden by the mob as a passenger,
    e.g. /beast-mob set zombie passenger random-rider, or
  • dropped when a block is mined,
    e.g. /beast-zone add-block world_nether quartz_ore quartz-ore-drops.

Consult the Mob Property Reference for mob properties that can be assigned loot table IDs.

Zones can also be configured to use loot tables to randomly select a replacement for individual types of naturally spawned mobs. For example, to replace endermen that spawn naturally in the world_the_end zone with a mob that is selected randomly from the end-mobs table, use:

/beast-zone replace-mob world_the_end enderman end-mobs

Demonstration Mob

In order to demonstrate loot table concepts, we'll define a test mob (a type of wither skeleton) called a knight:

/beast-mob add knight witherskeleton

And we'll define some test items:

  • Holding a red leather chest plate, define the red-chest item with:
    /beast-item define red-chest.
  • Holding a blue leather chest plate, define the blue-chest item with:
    /beast-item define blue-chest.
  • Holding a gold nugget, define knight-gold with:
    /best-item define knight-gold
  • Holding an iron nugget, define knight-silver with:
    /best-item define knight-silver

Example: Creating a Loot Table to Select Worn Armour

For our demonstration mob, we want to use a loot table to randomly select the chest plate worn by our knight, so we run the following commands:

/beast-loot add knight-chest
/beast-loot add-drop knight-chest item red-chest 30
/beast-loot add-drop knight-chest item blue-chest 30

Those commands create a the knight-chest loot table with a 30% chance of selecting the red-chest item and a 30% chance of selecting the blue-chest item.

We can then configure the knight to wear whatever that table selects with:

/beast-mob set knight chest-plate knight-chest

Finally, we can spawn an inert statue of our new mob with:

/beast-mob statue knight here

Listing Loot Tables and their Contents

We can list all of the loot tables defined so far with:

/beast-loot list

And we can get a description of our new loot table with:

/beast-loot info knight-chest

Single- vs Multiple-Selection Loot Tables

If you spawn a few more knight statues, you may begin to suspect that something is not quite right. The total probability of the knight wearing a chest plate is 30% + 30% = 60%. The outcome is not specified the other 40% of the time. And yet all of the knights end up wearing either a red chestplate or a blue one. There are no knights that don't wear a chest plate.

The reason for this is that, loot tables have two distinct modes of operation: single-selection and multiple-selection. Loot tables will, by default, select multiple items, but when used for certain specific purposes (such as selecting worn or held items), only a single item will be selected, as if the table had been configured for single-selection mode.

We can change the knight-chest loot table to select no armour easily enough:

/beast-loot add-drop knight-chest nothing 40

That is exactly the same as saying:

/beast-loot add-drop knight-chest item air 40

which adds the pre-defined item air as a possible outcome of the selection process.

== Single-Selection is Weighted Selection ==

When a loot table is used to select a single item, either because it is configured for single-selection, or because it's used in a context where it implicitly has to be single-selection, the table returns a weighted selection of its entries. With weighted selection the probability of selecting any loot table drop is the weight of that entry divided by the sum of the weights of all entries.

So for example, if we set the weight for the nothing drop to 100:

/beast-loot add-drop knight-chest nothing 100

then the total weight would be 30 + 30 + 100 = 160, and the chance of selecting a red leather chest plate, for example, would be 30 / 160 * 100% = 18.75%. The chance of the knight wearing nothing as a chest plate would be 100 / 160 * 100% = 62.5%. Note however, that /beast-loot info knight will still show the drop probabilities as 30%, 30% and 100%. This is because it's not possible for a multiple-selection table to know in advance when it will be used for a single-selection purpose.

Explicitly Configuring Single-Selection

You can configure a loot table to always select a single item in all cases:

/beast-loot single knight-chest yes

Currently, this doesn't change the output of /beast-loot info to reflect the effective drop probabilities due to weighted selection, but it probably will in the future. Explicitly configuring single-selection mode is most useful for selecting a dropped item when a mob dies, or when a block is mined.

Implicit Single-Selection Contexts

The specific cases where a multiple-selection loot table behaves as a single-selection table are:

  • when selecting armour for a mob to wear or items to hold,
  • when selecting a mob to spawn as a passenger of another mob, and
  • when selecting the mob that will replace a natural-spawned mob in a zone,

Example: Configuring Items Dropped on Mob Death - Multiple-Selection

We'll create another loot table to represent the items dropped by the knight when it dies:

/beast-loot add knight-drops
/beast-loot add-drop knight-drops item knight-gold 20
/beast-loot add-drop knight-drops item knight-silver 40 10 20
/beast-mob set knight drops knight-drops

The last command configures the knight mob to drop items from the knight-drops loot table when it dies.

If you run /beast-loot info knight-drops, you will see that the loot table is described as multiple (meaning multiple-selection) and has two entries: a 20% chance of dropping one knight-gold and a 40% chance of dropping 5-10 knight-silver.

Note that since no minimum or maximum number of knight-gold items to drop was specified, that loot table entry defaulted to dropping exactly one item (no more, no less).

If you then go ahead and spawn some more knight statues (/beast-mob statue knight here) and kill them, you'll see they sometimes drop iron nuggets, sometimes 1 gold nugget, sometimes both and sometimes neither.

How Multiple-Selection Works

When a multiple-selection loot table is called upon to produce drops, BeastMaster steps through all of the entries in the table and for each entry does the following:

  • Chose a random number from 0 to 100%.
  • If the random number is less than the probability of the entry, then that entry is dropped. A new item stack of the entry's item type is created and the number of items in the stack is set as another random value between the minimum and maximum number of items specified.
  • If the random number is greater than or equal to the probability of the entry, then BeastMaster moves on to the next one.

The Mathematics of Multiple-Selection

Imagine that you are using a multiple-selection loot table in a context where multiple items can be selected (e.g. mob death drops). Say the table has 10 entries which each drop a single item with a probability of 2%. The average chance of getting at least one item to drop is 10 * 2% = 20%.

Minecraft has certain conventions for how often valuable items drop. Wither skulls drop at a rate of 2.5% (1 in 40), or 4% (1 in 25) when using Looting 3. If you have custom drops from a loot table that are notionally valuable, you probably don't want to set the total probability of one of them dropping much higher than about 5%; so if you have 10 of them, then you might reasonably choose to give each drop a probability of only 0.5%.

The default Drop

After a while of killing knights you will notice that they don't drop the normal things that wither skeletons would normally drop - skulls, bones, coal, stone swords. Those drops only occur when the loot table includes an entry for the default drop, for example:

/beast-loot add-drop knight-drops default 100

If you set the percentage chance of the default drop to 100%, then you will get exactly the same amount of that vanilla Minecraft loot as the vanilla Minecraft mob would drop by default. But you can reduce that. For example, to halve the amount of default drops a mob produces:

/beast-loot add-drop knight-drops default 50

Note that this doesn't change the number of items in each dropped item stack. Instead, it reduces how often the default drop is allowed to come into the world (in this case to 50% of the time). However, on average, over time, the effect on the total amount of default loot dropped by the mob is the same: a reduction to 50%.

The nothing Drop

Loot tables can be configured to drop nothing, as already demonstrated with the knight-chest. This kind of drop is only useful in the case where the loot table will be used to produce a single item. In the case of a multi-selection mode table, in a context where it can drop multiple items, all of the drops that are not nothing will have a chance to produce something that is not nothing. Even if the table drops "nothing", since it's multiple-selection, it can also drop "something" as well, and something plus nothing is something.

Item Drops

Mob Drops

Drop Properties

Loot Table Command Reference


Start: Home ⬩ Previous: Mobs ⬩ Next: Zones