Package net.minecraft.util.random
Class WeightedRandom
java.lang.Object
net.minecraft.util.random.WeightedRandom
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends WeightedEntry>
Optional<T> getRandomItem
(RandomSource p_216823_, List<T> p_216824_) static <T extends WeightedEntry>
Optional<T> getRandomItem
(RandomSource p_216826_, List<T> p_216827_, int p_216828_) static int
getTotalWeight
(List<? extends WeightedEntry> p_146313_) static <T extends WeightedEntry>
Optional<T> getWeightedItem
(List<T> p_146315_, int p_146316_)
-
Constructor Details
-
WeightedRandom
private WeightedRandom()
-
-
Method Details
-
getTotalWeight
-
getRandomItem
public static <T extends WeightedEntry> Optional<T> getRandomItem(RandomSource p_216826_, List<T> p_216827_, int p_216828_) -
getWeightedItem
public static <T extends WeightedEntry> Optional<T> getWeightedItem(List<T> p_146315_, int p_146316_) -
getRandomItem
public static <T extends WeightedEntry> Optional<T> getRandomItem(RandomSource p_216823_, List<T> p_216824_)
-