Package net.minecraft.enchantment
Enum Enchantment.Rarity
- All Implemented Interfaces:
Serializable,Comparable<Enchantment.Rarity>,java.lang.constant.Constable
- Enclosing class:
- Enchantment
public static enum Enchantment.Rarity extends Enum<Enchantment.Rarity>
The rarity is an attribute of an enchantment.
It affects the chance of getting an enchantment from enchanting or loots as well as the combination cost in anvil.
- Mappings:
Namespace Name official brp$aintermediary net/minecraft/class_1887$class_1888named net/minecraft/enchantment/Enchantment$Rarity
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
-
Field Summary
Fields Modifier and Type Field Description private intweight -
Constructor Summary
Constructors Modifier Constructor Description privateRarity(int weight) -
Method Summary
Modifier and Type Method Description intgetWeight()Returns the weight of an enchantment in weighted pickers.static Enchantment.RarityvalueOf(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.
-
Enum Constant Details
-
COMMON
- Mappings:
Namespace Name Mixin selector official aLbrp$a;a:Lbrp$a;intermediary field_9087Lnet/minecraft/class_1887$class_1888;field_9087:Lnet/minecraft/class_1887$class_1888;named COMMONLnet/minecraft/enchantment/Enchantment$Rarity;COMMON:Lnet/minecraft/enchantment/Enchantment$Rarity;
-
UNCOMMON
- Mappings:
Namespace Name Mixin selector official bLbrp$a;b:Lbrp$a;intermediary field_9090Lnet/minecraft/class_1887$class_1888;field_9090:Lnet/minecraft/class_1887$class_1888;named UNCOMMONLnet/minecraft/enchantment/Enchantment$Rarity;UNCOMMON:Lnet/minecraft/enchantment/Enchantment$Rarity;
-
RARE
- Mappings:
Namespace Name Mixin selector official cLbrp$a;c:Lbrp$a;intermediary field_9088Lnet/minecraft/class_1887$class_1888;field_9088:Lnet/minecraft/class_1887$class_1888;named RARELnet/minecraft/enchantment/Enchantment$Rarity;RARE:Lnet/minecraft/enchantment/Enchantment$Rarity;
-
VERY_RARE
- Mappings:
Namespace Name Mixin selector official dLbrp$a;d:Lbrp$a;intermediary field_9091Lnet/minecraft/class_1887$class_1888;field_9091:Lnet/minecraft/class_1887$class_1888;named VERY_RARELnet/minecraft/enchantment/Enchantment$Rarity;VERY_RARE:Lnet/minecraft/enchantment/Enchantment$Rarity;
-
-
Field Details
-
weight
private final int weight- Mappings:
Namespace Name Mixin selector official eLbrp$a;e:Iintermediary field_9089Lnet/minecraft/class_1887$class_1888;field_9089:Inamed weightLnet/minecraft/enchantment/Enchantment$Rarity;weight:I
-
-
Constructor Details
-
Rarity
private Rarity(int weight)- Mappings:
Namespace Name Mixin selector official <init>Lbrp$a;<init>(Ljava/lang/String;II)Vintermediary <init>Lnet/minecraft/class_1887$class_1888;<init>(Ljava/lang/String;II)Vnamed <init>Lnet/minecraft/enchantment/Enchantment$Rarity;<init>(Ljava/lang/String;II)V
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getWeight
public int getWeight()Returns the weight of an enchantment in weighted pickers.- Mappings:
Namespace Name Mixin selector official aLbrp$a;a()Iintermediary method_8197Lnet/minecraft/class_1887$class_1888;method_8197()Inamed getWeightLnet/minecraft/enchantment/Enchantment$Rarity;getWeight()I
-