public static enum Enchantment.Rarity extends Enum<Enchantment.Rarity>
It affects the chance of getting an enchantment from enchanting or loots as well as the combination cost in anvil.
Modifier and Type | Field and Description |
---|---|
private int |
weight |
Modifier and Type | Method and Description |
---|---|
int |
getWeight()
Returns the weight of an enchantment in weighted pickers.
|
static Enchantment.Rarity |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Enchantment.Rarity[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Enchantment.Rarity COMMON
public static final Enchantment.Rarity UNCOMMON
public static final Enchantment.Rarity RARE
public static final Enchantment.Rarity VERY_RARE
public static Enchantment.Rarity[] values()
for (Enchantment.Rarity c : Enchantment.Rarity.values()) System.out.println(c);
public static Enchantment.Rarity valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getWeight()