Class PossibleDrop

java.lang.Object
me.fami6xx.rpuniverse.core.jobs.PossibleDrop

public class PossibleDrop extends Object
Represents a possible drop that can occur upon completing a working step. Holds an ItemStack and the percentage chance that it will drop.
  • Constructor Details

    • PossibleDrop

      public PossibleDrop(@Nonnull org.bukkit.inventory.ItemStack item, double chance)
      Creates a new PossibleDrop with the specified item and chance.
      Parameters:
      item - The ItemStack that might drop.
      chance - The probability (0.0 to 100.0) that the item will drop. Values outside of this range will throw an IllegalArgumentException.
  • Method Details

    • getItem

      @Nonnull public org.bukkit.inventory.ItemStack getItem()
      Returns:
      The ItemStack associated with this drop.
    • getChance

      public double getChance()
      Returns:
      The percentage chance (0.0 to 100.0) that this item will drop.
    • setChance

      public void setChance(double chance)
      Sets the chance that this item will drop.

      Values outside the range 0.0 to 100.0 will throw an IllegalArgumentException.

      Parameters:
      chance - The probability (0.0 to 100.0) that the item will drop.