net.minecraft.util

## Class WeightedRandom

- java.lang.Object
- - net.minecraft.util.WeightedRandom

-     public class WeightedRandom
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WeightedRandom()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static WeightedRandomItem` | `getRandomItem(Random par0Random, Collection par1Collection)` Returns a random choice from the input items.
    `static WeightedRandomItem` | `getRandomItem(Random par0Random, Collection par1Collection, int par2)` Returns a random choice from the input items, with a total weight value.
    `static WeightedRandomItem` | `getRandomItem(Random par0Random, WeightedRandomItem[] par1ArrayOfWeightedRandomItem)` Returns a random choice from the input items.
    `static WeightedRandomItem` | `getRandomItem(Random par0Random, WeightedRandomItem[] par1ArrayOfWeightedRandomItem, int par2)` Returns a random choice from the input array of items, with a total weight value.
    `static int` | `getTotalWeight(Collection par0Collection)` Returns the total weight of all items in a collection.
    `static int` | `getTotalWeight(WeightedRandomItem[] par0ArrayOfWeightedRandomItem)` Returns the total weight of all items in a array.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### WeightedRandom

          public WeightedRandom()

  - ### Method Detail

    - #### getTotalWeight

          public static int getTotalWeight(Collection par0Collection)

      Returns the total weight of all items in a collection.

    - #### getRandomItem

          public static WeightedRandomItem getRandomItem(Random par0Random,
                                         Collection par1Collection,
                                         int par2)

      Returns a random choice from the input items, with a total weight value.

    - #### getRandomItem

          public static WeightedRandomItem getRandomItem(Random par0Random,
                                         Collection par1Collection)

      Returns a random choice from the input items.

    - #### getTotalWeight

          public static int getTotalWeight(WeightedRandomItem[] par0ArrayOfWeightedRandomItem)

      Returns the total weight of all items in a array.

    - #### getRandomItem

          public static WeightedRandomItem getRandomItem(Random par0Random,
                                         WeightedRandomItem[] par1ArrayOfWeightedRandomItem,
                                         int par2)

      Returns a random choice from the input array of items, with a total weight value.

    - #### getRandomItem

          public static WeightedRandomItem getRandomItem(Random par0Random,
                                         WeightedRandomItem[] par1ArrayOfWeightedRandomItem)

      Returns a random choice from the input items.