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
ConstructorDescriptionMinecraftLootTable(String nameSpaceString)
Load an existing minecraft loot table (includes loot table from data packs). -
Method Summary
Modifier and TypeMethodDescriptionvoid
fillBrewerInventory(org.bukkit.inventory.BrewerInventory brewerInventory, Random random, org.bukkit.Location location)
Fills a brewer with items.void
fillContainerInventory(org.bukkit.inventory.Inventory inventory, Random random, org.bukkit.Location location)
Fills a container's inventory with items.void
fillFurnaceInventory(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.int
getRolls()
Get the number of items chosen.void
setRolls(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:LootTable
Set 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:LootTable
Fills a container's inventory with items.Override this method to replace the default functionality.
- Overrides:
fillContainerInventory
in 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:LootTable
Fills a furnace inventory with items.Override this method to replace the default functionality.
- Overrides:
fillFurnaceInventory
in 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:LootTable
Fills a brewer with items.Override this method to replace the default functionality.
- Overrides:
fillBrewerInventory
in classLootTable
- Parameters:
brewerInventory
- The brewer invetory to fill.random
- The randomizer.location
- The location of the furnace.
-