Class MinecraftLootTable
java.lang.Object
com.ryandw11.structure.loottables.LootTable
com.ryandw11.structure.loottables.MinecraftLootTable
Represents a loaded Minecraft loot table.
Example: minecraft:chests/abandoned_mineshaft
This also works with loot tables provided by datapacks.
-
Field Summary
Fields inherited from class com.ryandw11.structure.loottables.LootTable
randomCollection, types -
Constructor Summary
ConstructorsConstructorDescriptionMinecraftLootTable(String nameSpaceString)Load an existing minecraft loot table (includes loot table from data packs). -
Method Summary
Modifier and TypeMethodDescriptionvoidfillBrewerInventory(org.bukkit.inventory.BrewerInventory brewerInventory, Random random, org.bukkit.Location location)Fills a brewer with items.voidfillContainerInventory(org.bukkit.inventory.Inventory inventory, Random random, org.bukkit.Location location)Fills a container's inventory with items.voidfillFurnaceInventory(org.bukkit.inventory.FurnaceInventory furnaceInventory, Random random, org.bukkit.Location location)Fills a furnace inventory with items.getName()Get the name of the loot table.intgetRolls()Get the number of items chosen.voidsetRolls(int rolls)Set the number of rolls for the loot table.Methods inherited from class com.ryandw11.structure.loottables.LootTable
addLootItem, addType, getItems, getRandomWeightedItem, getTypes, setTypes
-
Constructor Details
-
MinecraftLootTable
Load an existing minecraft loot table (includes loot table from data packs).- Parameters:
nameSpaceString- The loot table name space.
-
-
Method Details
-
getName
Get the name of the loot table. -
getRolls
public int getRolls()Get the number of items chosen. -
setRolls
public void setRolls(int rolls)Description copied from class:LootTableSet the number of rolls for the loot table.An implementation of this method is not strictly necessary.
-
fillContainerInventory
public void fillContainerInventory(org.bukkit.inventory.Inventory inventory, Random random, org.bukkit.Location location)Description copied from class:LootTableFills a container's inventory with items.Override this method to replace the default functionality.
- Overrides:
fillContainerInventoryin classLootTable- Parameters:
inventory- The inventory to fill.random- The randomizer.location- The location of the container.
-
fillFurnaceInventory
public void fillFurnaceInventory(org.bukkit.inventory.FurnaceInventory furnaceInventory, Random random, org.bukkit.Location location)Description copied from class:LootTableFills a furnace inventory with items.Override this method to replace the default functionality.
- Overrides:
fillFurnaceInventoryin classLootTable- Parameters:
furnaceInventory- The furnace inventory to fill.random- The randomizer.location- The location of the furnace.
-
fillBrewerInventory
public void fillBrewerInventory(org.bukkit.inventory.BrewerInventory brewerInventory, Random random, org.bukkit.Location location)Description copied from class:LootTableFills a brewer with items.Override this method to replace the default functionality.
- Overrides:
fillBrewerInventoryin classLootTable- Parameters:
brewerInventory- The brewer invetory to fill.random- The randomizer.location- The location of the furnace.
-