Package net.minecraft.enchantment
Class Enchantment
java.lang.Object
net.minecraft.enchantment.Enchantment
- Direct Known Subclasses:
AquaAffinityEnchantment,BindingCurseEnchantment,ChannelingEnchantment,DamageEnchantment,DepthStriderEnchantment,EfficiencyEnchantment,FireAspectEnchantment,FlameEnchantment,FrostWalkerEnchantment,ImpalingEnchantment,InfinityEnchantment,KnockbackEnchantment,LoyaltyEnchantment,LuckEnchantment,LureEnchantment,MendingEnchantment,MultishotEnchantment,PiercingEnchantment,PowerEnchantment,ProtectionEnchantment,PunchEnchantment,QuickChargeEnchantment,RespirationEnchantment,RiptideEnchantment,SilkTouchEnchantment,SoulSpeedEnchantment,SweepingEnchantment,SwiftSneakEnchantment,ThornsEnchantment,UnbreakingEnchantment,VanishingCurseEnchantment
- Mappings:
Namespace Name official cnfintermediary net/minecraft/class_1887named net/minecraft/enchantment/Enchantment
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe rarity is an attribute of an enchantment. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RegistryEntry.Reference<Enchantment>private final Enchantment.Rarityprivate final EquipmentSlot[]final EnchantmentTarget -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEnchantment(Enchantment.Rarity rarity, EnchantmentTarget target, EquipmentSlot[] slotTypes) -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable EnchantmentbyRawId(int id) protected booleancanAccept(Enchantment other) Returns whether this enchantment can exist on an item stack with theotherenchantment.final booleancanCombine(Enchantment other) Returns whether this enchantment can exist on an item stack with theotherenchantment and theotherenchantment can exist with this enchantment.floatgetAttackDamage(int level, EntityGroup group) getEquipment(LivingEntity entity) intintgetMaxPower(int level) intintgetMinPower(int level) getName(int level) protected StringintgetProtectionAmount(int level, DamageSource source) booleanisAcceptableItem(ItemStack stack) booleanReturns whether this enchantment will appear in the enchanted book trade offers of librarian villagers.booleanReturns whether this enchantment will appear in the enchanting table or loots with random enchant function.booleanisCursed()booleanDeprecated.voidonTargetDamaged(LivingEntity user, Entity target, int level) voidonUserDamaged(LivingEntity user, Entity attacker, int level)
-
Field Details
-
slotTypes
- Mappings:
Namespace Name Mixin selector official aLcnf;a:[Lbin;intermediary field_9086Lnet/minecraft/class_1887;field_9086:[Lnet/minecraft/class_1304;named slotTypesLnet/minecraft/enchantment/Enchantment;slotTypes:[Lnet/minecraft/entity/EquipmentSlot;
-
rarity
- Mappings:
Namespace Name Mixin selector official bLcnf;b:Lcnf$a;intermediary field_9085Lnet/minecraft/class_1887;field_9085:Lnet/minecraft/class_1887$class_1888;named rarityLnet/minecraft/enchantment/Enchantment;rarity:Lnet/minecraft/enchantment/Enchantment$Rarity;
-
target
- Mappings:
Namespace Name Mixin selector official eLcnf;e:Lcng;intermediary field_9083Lnet/minecraft/class_1887;field_9083:Lnet/minecraft/class_1886;named targetLnet/minecraft/enchantment/Enchantment;target:Lnet/minecraft/enchantment/EnchantmentTarget;
-
translationKey
- Mappings:
Namespace Name Mixin selector official fLcnf;f:Ljava/lang/String;intermediary field_9084Lnet/minecraft/class_1887;field_9084:Ljava/lang/String;named translationKeyLnet/minecraft/enchantment/Enchantment;translationKey:Ljava/lang/String;
-
field_45769
- Mappings:
Namespace Name Mixin selector official cLcnf;c:Lhe$c;intermediary field_45769Lnet/minecraft/class_1887;field_45769:Lnet/minecraft/class_6880$class_6883;named field_45769Lnet/minecraft/enchantment/Enchantment;field_45769:Lnet/minecraft/registry/entry/RegistryEntry$Reference;
-
-
Constructor Details
-
Enchantment
protected Enchantment(Enchantment.Rarity rarity, EnchantmentTarget target, EquipmentSlot[] slotTypes) - Mappings:
Namespace Name Mixin selector official <init>Lcnf;<init>(Lcnf$a;Lcng;[Lbin;)Vintermediary <init>Lnet/minecraft/class_1887;<init>(Lnet/minecraft/class_1887$class_1888;Lnet/minecraft/class_1886;[Lnet/minecraft/class_1304;)Vnamed <init>Lnet/minecraft/enchantment/Enchantment;<init>(Lnet/minecraft/enchantment/Enchantment$Rarity;Lnet/minecraft/enchantment/EnchantmentTarget;[Lnet/minecraft/entity/EquipmentSlot;)V
-
-
Method Details
-
byRawId
- Mappings:
Namespace Name Mixin selector official cLcnf;c(I)Lcnf;intermediary method_8191Lnet/minecraft/class_1887;method_8191(I)Lnet/minecraft/class_1887;named byRawIdLnet/minecraft/enchantment/Enchantment;byRawId(I)Lnet/minecraft/enchantment/Enchantment;
-
getEquipment
- Mappings:
Namespace Name Mixin selector official aLcnf;a(Lbiy;)Ljava/util/Map;intermediary method_8185Lnet/minecraft/class_1887;method_8185(Lnet/minecraft/class_1309;)Ljava/util/Map;named getEquipmentLnet/minecraft/enchantment/Enchantment;getEquipment(Lnet/minecraft/entity/LivingEntity;)Ljava/util/Map;
-
getRarity
- Mappings:
Namespace Name Mixin selector official dLcnf;d()Lcnf$a;intermediary method_8186Lnet/minecraft/class_1887;method_8186()Lnet/minecraft/class_1887$class_1888;named getRarityLnet/minecraft/enchantment/Enchantment;getRarity()Lnet/minecraft/enchantment/Enchantment$Rarity;
-
getMinLevel
public int getMinLevel()- Mappings:
Namespace Name Mixin selector official eLcnf;e()Iintermediary method_8187Lnet/minecraft/class_1887;method_8187()Inamed getMinLevelLnet/minecraft/enchantment/Enchantment;getMinLevel()I
-
getMaxLevel
public int getMaxLevel()- Mappings:
Namespace Name Mixin selector official aLcnf;a()Iintermediary method_8183Lnet/minecraft/class_1887;method_8183()Inamed getMaxLevelLnet/minecraft/enchantment/Enchantment;getMaxLevel()I
-
getMinPower
public int getMinPower(int level) - Mappings:
Namespace Name Mixin selector official aLcnf;a(I)Iintermediary method_8182Lnet/minecraft/class_1887;method_8182(I)Inamed getMinPowerLnet/minecraft/enchantment/Enchantment;getMinPower(I)I
-
getMaxPower
public int getMaxPower(int level) - Mappings:
Namespace Name Mixin selector official bLcnf;b(I)Iintermediary method_20742Lnet/minecraft/class_1887;method_20742(I)Inamed getMaxPowerLnet/minecraft/enchantment/Enchantment;getMaxPower(I)I
-
getProtectionAmount
- Mappings:
Namespace Name Mixin selector official aLcnf;a(ILbhg;)Iintermediary method_8181Lnet/minecraft/class_1887;method_8181(ILnet/minecraft/class_1282;)Inamed getProtectionAmountLnet/minecraft/enchantment/Enchantment;getProtectionAmount(ILnet/minecraft/entity/damage/DamageSource;)I
-
getAttackDamage
- Mappings:
Namespace Name Mixin selector official aLcnf;a(ILbjd;)Fintermediary method_8196Lnet/minecraft/class_1887;method_8196(ILnet/minecraft/class_1310;)Fnamed getAttackDamageLnet/minecraft/enchantment/Enchantment;getAttackDamage(ILnet/minecraft/entity/EntityGroup;)F
-
canCombine
Returns whether this enchantment can exist on an item stack with theotherenchantment and theotherenchantment can exist with this enchantment.- Returns:
- whether this enchantment can exist on an item stack with the
otherenchantment and theotherenchantment can exist with this enchantment - Mappings:
Namespace Name Mixin selector official bLcnf;b(Lcnf;)Zintermediary method_8188Lnet/minecraft/class_1887;method_8188(Lnet/minecraft/class_1887;)Znamed canCombineLnet/minecraft/enchantment/Enchantment;canCombine(Lnet/minecraft/enchantment/Enchantment;)Z
-
canAccept
Returns whether this enchantment can exist on an item stack with theotherenchantment.- Returns:
- whether this enchantment can exist on an item stack with the
otherenchantment - Mappings:
Namespace Name Mixin selector official aLcnf;a(Lcnf;)Zintermediary method_8180Lnet/minecraft/class_1887;method_8180(Lnet/minecraft/class_1887;)Znamed canAcceptLnet/minecraft/enchantment/Enchantment;canAccept(Lnet/minecraft/enchantment/Enchantment;)Z
-
getOrCreateTranslationKey
- Mappings:
Namespace Name Mixin selector official fLcnf;f()Ljava/lang/String;intermediary method_8190Lnet/minecraft/class_1887;method_8190()Ljava/lang/String;named getOrCreateTranslationKeyLnet/minecraft/enchantment/Enchantment;getOrCreateTranslationKey()Ljava/lang/String;
-
getTranslationKey
- Mappings:
Namespace Name Mixin selector official gLcnf;g()Ljava/lang/String;intermediary method_8184Lnet/minecraft/class_1887;method_8184()Ljava/lang/String;named getTranslationKeyLnet/minecraft/enchantment/Enchantment;getTranslationKey()Ljava/lang/String;
-
getName
- Mappings:
Namespace Name Mixin selector official dLcnf;d(I)Ltf;intermediary method_8179Lnet/minecraft/class_1887;method_8179(I)Lnet/minecraft/class_2561;named getNameLnet/minecraft/enchantment/Enchantment;getName(I)Lnet/minecraft/text/Text;
-
isAcceptableItem
- Mappings:
Namespace Name Mixin selector official aLcnf;a(Lciy;)Zintermediary method_8192Lnet/minecraft/class_1887;method_8192(Lnet/minecraft/class_1799;)Znamed isAcceptableItemLnet/minecraft/enchantment/Enchantment;isAcceptableItem(Lnet/minecraft/item/ItemStack;)Z
-
onTargetDamaged
- Mappings:
Namespace Name Mixin selector official aLcnf;a(Lbiy;Lbii;I)Vintermediary method_8189Lnet/minecraft/class_1887;method_8189(Lnet/minecraft/class_1309;Lnet/minecraft/class_1297;I)Vnamed onTargetDamagedLnet/minecraft/enchantment/Enchantment;onTargetDamaged(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/Entity;I)V
-
onUserDamaged
- Mappings:
Namespace Name Mixin selector official bLcnf;b(Lbiy;Lbii;I)Vintermediary method_8178Lnet/minecraft/class_1887;method_8178(Lnet/minecraft/class_1309;Lnet/minecraft/class_1297;I)Vnamed onUserDamagedLnet/minecraft/enchantment/Enchantment;onUserDamaged(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/Entity;I)V
-
isTreasure
public boolean isTreasure()- Mappings:
Namespace Name Mixin selector official bLcnf;b()Zintermediary method_8193Lnet/minecraft/class_1887;method_8193()Znamed isTreasureLnet/minecraft/enchantment/Enchantment;isTreasure()Z
-
isCursed
public boolean isCursed()- Mappings:
Namespace Name Mixin selector official cLcnf;c()Zintermediary method_8195Lnet/minecraft/class_1887;method_8195()Znamed isCursedLnet/minecraft/enchantment/Enchantment;isCursed()Z
-
isAvailableForEnchantedBookOffer
public boolean isAvailableForEnchantedBookOffer()Returns whether this enchantment will appear in the enchanted book trade offers of librarian villagers.- Returns:
- whether this enchantment will appear in the enchanted book trade offers of librarian villagers
- Mappings:
Namespace Name Mixin selector official hLcnf;h()Zintermediary method_25949Lnet/minecraft/class_1887;method_25949()Znamed isAvailableForEnchantedBookOfferLnet/minecraft/enchantment/Enchantment;isAvailableForEnchantedBookOffer()Z
-
isAvailableForRandomSelection
public boolean isAvailableForRandomSelection()Returns whether this enchantment will appear in the enchanting table or loots with random enchant function.- Returns:
- whether this enchantment will appear in the enchanting table or loots with random enchant function
- Mappings:
Namespace Name Mixin selector official iLcnf;i()Zintermediary method_25950Lnet/minecraft/class_1887;method_25950()Znamed isAvailableForRandomSelectionLnet/minecraft/enchantment/Enchantment;isAvailableForRandomSelection()Z
-
method_53216
Deprecated.- Mappings:
Namespace Name Mixin selector official jLcnf;j()Lhe$c;intermediary method_53216Lnet/minecraft/class_1887;method_53216()Lnet/minecraft/class_6880$class_6883;named method_53216Lnet/minecraft/enchantment/Enchantment;method_53216()Lnet/minecraft/registry/entry/RegistryEntry$Reference;
-