Class MinecraftLootTable

java.lang.Object
com.ryandw11.structure.loottables.LootTable
com.ryandw11.structure.loottables.MinecraftLootTable

public class MinecraftLootTable extends LootTable
Represents a loaded Minecraft loot table.

Example: minecraft:chests/abandoned_mineshaft

This also works with loot tables provided by datapacks.

  • Constructor Details

    • MinecraftLootTable

      public MinecraftLootTable(String nameSpaceString)
      Load an existing minecraft loot table (includes loot table from data packs).
      Parameters:
      nameSpaceString - The loot table name space.
  • Method Details

    • getName

      public String getName()
      Get the name of the loot table.
      Specified by:
      getName in class LootTable
      Returns:
      The name of the loot table.
    • getRolls

      public int getRolls()
      Get the number of items chosen.
      Specified by:
      getRolls in class LootTable
      Returns:
      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.

      Specified by:
      setRolls in class LootTable
      Parameters:
      rolls - The number of rolls for the loot tables.
    • 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 class LootTable
      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 class LootTable
      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 class LootTable
      Parameters:
      brewerInventory - The brewer invetory to fill.
      random - The randomizer.
      location - The location of the furnace.