Package net.minecraft.enchantment
Class Enchantment
java.lang.Object
net.minecraft.enchantment.Enchantment
- Direct Known Subclasses:
BindingCurseEnchantment,DamageEnchantment,DepthStriderEnchantment,FrostWalkerEnchantment,InfinityEnchantment,LuckEnchantment,MendingEnchantment,MultishotEnchantment,PiercingEnchantment,ProtectionEnchantment,RiptideEnchantment,SilkTouchEnchantment,SoulSpeedEnchantment,SwiftSneakEnchantment,ThornsEnchantment,UnbreakingEnchantment,VanishingCurseEnchantment
- Mappings:
Namespace Name official dadintermediary net/minecraft/class_1887named net/minecraft/enchantment/Enchantment
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Enchantment.Propertiesprivate final RegistryEntry.Reference<Enchantment> -
Constructor Summary
Constructors -
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.static Enchantment.CostconstantCost(int base) final intfloatgetAttackDamage(int level, @Nullable EntityType<?> entityType) getEquipment(LivingEntity entity) final intfinal intgetMaxPower(int level) final intfinal intgetMinPower(int level) getName(int level) protected StringintgetProtectionAmount(int level, DamageSource source) Deprecated.final intbooleanisAcceptableItem(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()final booleanisPrimaryItem(ItemStack stack) booleanstatic Enchantment.CostleveledCost(int base, int perLevel) voidonTargetDamaged(LivingEntity user, Entity target, int level) voidonUserDamaged(LivingEntity user, Entity attacker, int level) static Enchantment.Propertiesproperties(TagKey<Item> supportedItems, int weight, int maxLevel, Enchantment.Cost minCost, Enchantment.Cost maxCost, int anvilCost, EquipmentSlot[] slots) static Enchantment.Propertiesproperties(TagKey<Item> supportedItems, TagKey<Item> primaryItems, int weight, int maxLevel, Enchantment.Cost minCost, Enchantment.Cost maxCost, int anvilCost, EquipmentSlot[] slots)
-
Field Details
-
properties
- Mappings:
Namespace Name Mixin selector official bLdad;b:Ldad$b;intermediary field_50013Lnet/minecraft/class_1887;field_50013:Lnet/minecraft/class_1887$class_9427;named propertiesLnet/minecraft/enchantment/Enchantment;properties:Lnet/minecraft/enchantment/Enchantment$Properties;
-
translationKey
- Mappings:
Namespace Name Mixin selector official aLdad;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 cLdad;c:Lja$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
- Mappings:
Namespace Name Mixin selector official <init>Ldad;<init>(Ldad$b;)Vintermediary <init>Lnet/minecraft/class_1887;<init>(Lnet/minecraft/class_1887$class_9427;)Vnamed <init>Lnet/minecraft/enchantment/Enchantment;<init>(Lnet/minecraft/enchantment/Enchantment$Properties;)V
-
-
Method Details
-
constantCost
- Mappings:
Namespace Name Mixin selector official aLdad;a(I)Ldad$a;intermediary method_58440Lnet/minecraft/class_1887;method_58440(I)Lnet/minecraft/class_1887$class_9426;named constantCostLnet/minecraft/enchantment/Enchantment;constantCost(I)Lnet/minecraft/enchantment/Enchantment$Cost;
-
leveledCost
- Mappings:
Namespace Name Mixin selector official aLdad;a(II)Ldad$a;intermediary method_58441Lnet/minecraft/class_1887;method_58441(II)Lnet/minecraft/class_1887$class_9426;named leveledCostLnet/minecraft/enchantment/Enchantment;leveledCost(II)Lnet/minecraft/enchantment/Enchantment$Cost;
-
properties
public static Enchantment.Properties properties(TagKey<Item> supportedItems, TagKey<Item> primaryItems, int weight, int maxLevel, Enchantment.Cost minCost, Enchantment.Cost maxCost, int anvilCost, EquipmentSlot[] slots) - Mappings:
Namespace Name Mixin selector official aLdad;a(Lawt;Lawt;IILdad$a;Ldad$a;I[Lbsc;)Ldad$b;intermediary method_58443Lnet/minecraft/class_1887;method_58443(Lnet/minecraft/class_6862;Lnet/minecraft/class_6862;IILnet/minecraft/class_1887$class_9426;Lnet/minecraft/class_1887$class_9426;I[Lnet/minecraft/class_1304;)Lnet/minecraft/class_1887$class_9427;named propertiesLnet/minecraft/enchantment/Enchantment;properties(Lnet/minecraft/registry/tag/TagKey;Lnet/minecraft/registry/tag/TagKey;IILnet/minecraft/enchantment/Enchantment$Cost;Lnet/minecraft/enchantment/Enchantment$Cost;I[Lnet/minecraft/entity/EquipmentSlot;)Lnet/minecraft/enchantment/Enchantment$Properties;
-
properties
public static Enchantment.Properties properties(TagKey<Item> supportedItems, int weight, int maxLevel, Enchantment.Cost minCost, Enchantment.Cost maxCost, int anvilCost, EquipmentSlot[] slots) - Mappings:
Namespace Name Mixin selector official aLdad;a(Lawt;IILdad$a;Ldad$a;I[Lbsc;)Ldad$b;intermediary method_58442Lnet/minecraft/class_1887;method_58442(Lnet/minecraft/class_6862;IILnet/minecraft/class_1887$class_9426;Lnet/minecraft/class_1887$class_9426;I[Lnet/minecraft/class_1304;)Lnet/minecraft/class_1887$class_9427;named propertiesLnet/minecraft/enchantment/Enchantment;properties(Lnet/minecraft/registry/tag/TagKey;IILnet/minecraft/enchantment/Enchantment$Cost;Lnet/minecraft/enchantment/Enchantment$Cost;I[Lnet/minecraft/entity/EquipmentSlot;)Lnet/minecraft/enchantment/Enchantment$Properties;
-
byRawId
- Mappings:
Namespace Name Mixin selector official bLdad;b(I)Ldad;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 aLdad;a(Lbso;)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 cLdad;c()Lawt;intermediary method_56109Lnet/minecraft/class_1887;method_56109()Lnet/minecraft/class_6862;named getApplicableItemsLnet/minecraft/enchantment/Enchantment;getApplicableItems()Lnet/minecraft/registry/tag/TagKey;
-
isPrimaryItem
- Mappings:
Namespace Name Mixin selector official aLdad;a(Lcuh;)Zintermediary method_58444Lnet/minecraft/class_1887;method_58444(Lnet/minecraft/class_1799;)Znamed isPrimaryItemLnet/minecraft/enchantment/Enchantment;isPrimaryItem(Lnet/minecraft/item/ItemStack;)Z
-
getWeight
public final int getWeight()- Mappings:
Namespace Name Mixin selector official dLdad;d()Iintermediary method_58445Lnet/minecraft/class_1887;method_58445()Inamed getWeightLnet/minecraft/enchantment/Enchantment;getWeight()I
-
getAnvilCost
public final int getAnvilCost()- Mappings:
Namespace Name Mixin selector official eLdad;e()Iintermediary method_58446Lnet/minecraft/class_1887;method_58446()Inamed getAnvilCostLnet/minecraft/enchantment/Enchantment;getAnvilCost()I
-
getMinLevel
public final int getMinLevel()- Mappings:
Namespace Name Mixin selector official fLdad;f()Iintermediary method_8187Lnet/minecraft/class_1887;method_8187()Inamed getMinLevelLnet/minecraft/enchantment/Enchantment;getMinLevel()I
-
getMaxLevel
public final int getMaxLevel()- Mappings:
Namespace Name Mixin selector official gLdad;g()Iintermediary method_8183Lnet/minecraft/class_1887;method_8183()Inamed getMaxLevelLnet/minecraft/enchantment/Enchantment;getMaxLevel()I
-
getMinPower
public final int getMinPower(int level) - Mappings:
Namespace Name Mixin selector official cLdad;c(I)Iintermediary method_8182Lnet/minecraft/class_1887;method_8182(I)Inamed getMinPowerLnet/minecraft/enchantment/Enchantment;getMinPower(I)I
-
getMaxPower
public final int getMaxPower(int level) - Mappings:
Namespace Name Mixin selector official dLdad;d(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 aLdad;a(ILbqt;)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 aLdad;a(ILbsb;)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 bLdad;b(Ldad;)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 aLdad;a(Ldad;)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 hLdad;h()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 iLdad;i()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 eLdad;e(I)Lxe;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 bLdad;b(Lcuh;)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 aLdad;a(Lbso;Lbrv;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 bLdad;b(Lbso;Lbrv;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 aLdad;a()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 bLdad;b()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 jLdad;j()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 kLdad;k()Zintermediary method_25950Lnet/minecraft/class_1887;method_25950()Znamed isAvailableForRandomSelectionLnet/minecraft/enchantment/Enchantment;isAvailableForRandomSelection()Z
-
getRegistryEntry
Deprecated.- Mappings:
Namespace Name Mixin selector official lLdad;l()Lja$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;
-