Represents a Container or a
Mob that can have a loot table.
Container loot will only generate upon opening, and only when the container
is first opened.
Entities will only generate loot upon death.
Gets the Loot Table attached to this block or entity.
If a block/entity does not have a loot table, this will return null, NOT
an empty loot table.
Returns:
the Loot Table attached to this block or entity.
Since:
1.13
setLootTable
voidsetLootTable(@Nullable
@Nullable LootTable table,
long seed)
Set the loot table and seed for a container or entity at the same time.
If the provided loot table is null, the loot table will be reset to its default behavior.
Parameters:
table - the Loot Table this Container or Mob will have.
seed - the seed to used to generate loot. Default is 0.
Since:
1.13
hasLootTable
defaultbooleanhasLootTable()
Returns whether or not this object has a Loot Table
Returns:
Has a loot table
Since:
1.13
clearLootTable
defaultvoidclearLootTable()
Clears the associated Loot Table to this object, essentially resetting it to default