Class LootPool

java.lang.Object
dev.aurelium.auraskills.api.loot.LootOptioned
dev.aurelium.auraskills.api.loot.LootPool

public class LootPool extends LootOptioned
  • Constructor Details

    • LootPool

      public LootPool(String name, List<Loot> loot, double baseChance, int selectionPriority, boolean overrideVanillaLoot, Map<String,Object> options)
  • Method Details

    • getName

      public String getName()
    • getLoot

      public List<Loot> getLoot()
    • getBaseChance

      public double getBaseChance()
    • getSelectionPriority

      public int getSelectionPriority()
    • overridesVanillaLoot

      public boolean overridesVanillaLoot()
    • rollLoot

      public Optional<Loot> rollLoot(LootContextFilter filter)
      Rolls a Loot entry from the pool's loot list randomly based on each loot's weight. The chance of an entry being selected is the weight/totalWeight. Specific loot entries can be filtered out before selection using the LootContextFilter.
      Parameters:
      filter - a filter checked on each loot entry, if the filter returns false the loot entry is ignored.
      Returns:
      the selected Loot as an optional