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 cwzintermediary 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 Enchantment.Rarityprivate final RegistryEntry.Reference<Enchantment> private final EquipmentSlot[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEnchantment(Enchantment.Rarity rarity, TagKey<Item> applicableItems, 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, @Nullable EntityType<?> entityType) getEquipment(LivingEntity entity) intintgetMaxPower(int level) intintgetMinPower(int level) getName(int level) protected StringintgetProtectionAmount(int level, DamageSource source) Deprecated.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()booleanvoidonTargetDamaged(LivingEntity user, Entity target, int level) voidonUserDamaged(LivingEntity user, Entity attacker, int level)
-
Field Details
-
slotTypes
- Mappings:
Namespace Name Mixin selector official bLcwz;b:[Lbqh;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 cLcwz;c:Lcwz$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;
-
applicableItems
- Mappings:
Namespace Name Mixin selector official dLcwz;d:Lavt;intermediary field_48370Lnet/minecraft/class_1887;field_48370:Lnet/minecraft/class_6862;named applicableItemsLnet/minecraft/enchantment/Enchantment;applicableItems:Lnet/minecraft/registry/tag/TagKey;
-
translationKey
- Mappings:
Namespace Name Mixin selector official aLcwz;a:Ljava/lang/String;intermediary field_9084Lnet/minecraft/class_1887;field_9084:Ljava/lang/String;named translationKeyLnet/minecraft/enchantment/Enchantment;translationKey:Ljava/lang/String;
-
registryEntry
- Mappings:
Namespace Name Mixin selector official eLcwz;e:Lin$c;intermediary field_45769Lnet/minecraft/class_1887;field_45769:Lnet/minecraft/class_6880$class_6883;named registryEntryLnet/minecraft/enchantment/Enchantment;registryEntry:Lnet/minecraft/registry/entry/RegistryEntry$Reference;
-
-
Constructor Details
-
Enchantment
protected Enchantment(Enchantment.Rarity rarity, TagKey<Item> applicableItems, EquipmentSlot[] slotTypes) - Mappings:
Namespace Name Mixin selector official <init>Lcwz;<init>(Lcwz$a;Lavt;[Lbqh;)Vintermediary <init>Lnet/minecraft/class_1887;<init>(Lnet/minecraft/class_1887$class_1888;Lnet/minecraft/class_6862;[Lnet/minecraft/class_1304;)Vnamed <init>Lnet/minecraft/enchantment/Enchantment;<init>(Lnet/minecraft/enchantment/Enchantment$Rarity;Lnet/minecraft/registry/tag/TagKey;[Lnet/minecraft/entity/EquipmentSlot;)V
-
-
Method Details
-
byRawId
- Mappings:
Namespace Name Mixin selector official cLcwz;c(I)Lcwz;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 aLcwz;a(Lbqt;)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;
-
getApplicableItems
- Mappings:
Namespace Name Mixin selector official dLcwz;d()Lavt;intermediary method_56109Lnet/minecraft/class_1887;method_56109()Lnet/minecraft/class_6862;named getApplicableItemsLnet/minecraft/enchantment/Enchantment;getApplicableItems()Lnet/minecraft/registry/tag/TagKey;
-
getRarity
- Mappings:
Namespace Name Mixin selector official eLcwz;e()Lcwz$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 fLcwz;f()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 aLcwz;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 aLcwz;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 bLcwz;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 aLcwz;a(ILboy;)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 aLcwz;a(ILbqg;)Fintermediary method_8196Lnet/minecraft/class_1887;method_8196(ILnet/minecraft/class_1299;)Fnamed getAttackDamageLnet/minecraft/enchantment/Enchantment;getAttackDamage(ILnet/minecraft/entity/EntityType;)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 bLcwz;b(Lcwz;)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 aLcwz;a(Lcwz;)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 gLcwz;g()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 hLcwz;h()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 dLcwz;d(I)Lwi;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 aLcwz;a(Lcrs;)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 aLcwz;a(Lbqt;Lbqa;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 bLcwz;b(Lbqt;Lbqa;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 bLcwz;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 cLcwz;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 iLcwz;i()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 jLcwz;j()Zintermediary method_25950Lnet/minecraft/class_1887;method_25950()Znamed isAvailableForRandomSelectionLnet/minecraft/enchantment/Enchantment;isAvailableForRandomSelection()Z
-
getRegistryEntry
Deprecated.- Mappings:
Namespace Name Mixin selector official kLcwz;k()Lin$c;intermediary method_53216Lnet/minecraft/class_1887;method_53216()Lnet/minecraft/class_6880$class_6883;named getRegistryEntryLnet/minecraft/enchantment/Enchantment;getRegistryEntry()Lnet/minecraft/registry/entry/RegistryEntry$Reference;
-