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

public abstract class Enchantment extends Object
Mappings:
Namespace Name
official cno
intermediary net/minecraft/class_1887
named net/minecraft/enchantment/Enchantment
  • Field Details

    • slotTypes

      private final EquipmentSlot[] slotTypes
      Mappings:
      Namespace Name Mixin selector
      official a Lcno;a:[Lbiv;
      intermediary field_9086 Lnet/minecraft/class_1887;field_9086:[Lnet/minecraft/class_1304;
      named slotTypes Lnet/minecraft/enchantment/Enchantment;slotTypes:[Lnet/minecraft/entity/EquipmentSlot;
    • rarity

      private final Enchantment.Rarity rarity
      Mappings:
      Namespace Name Mixin selector
      official b Lcno;b:Lcno$a;
      intermediary field_9085 Lnet/minecraft/class_1887;field_9085:Lnet/minecraft/class_1887$class_1888;
      named rarity Lnet/minecraft/enchantment/Enchantment;rarity:Lnet/minecraft/enchantment/Enchantment$Rarity;
    • target

      public final EnchantmentTarget target
      Mappings:
      Namespace Name Mixin selector
      official e Lcno;e:Lcnp;
      intermediary field_9083 Lnet/minecraft/class_1887;field_9083:Lnet/minecraft/class_1886;
      named target Lnet/minecraft/enchantment/Enchantment;target:Lnet/minecraft/enchantment/EnchantmentTarget;
    • translationKey

      @Nullable protected @Nullable String translationKey
      Mappings:
      Namespace Name Mixin selector
      official f Lcno;f:Ljava/lang/String;
      intermediary field_9084 Lnet/minecraft/class_1887;field_9084:Ljava/lang/String;
      named translationKey Lnet/minecraft/enchantment/Enchantment;translationKey:Ljava/lang/String;
    • registryEntry

      private final RegistryEntry.Reference<Enchantment> registryEntry
      Mappings:
      Namespace Name Mixin selector
      official c Lcno;c:Lhe$c;
      intermediary field_45769 Lnet/minecraft/class_1887;field_45769:Lnet/minecraft/class_6880$class_6883;
      named registryEntry Lnet/minecraft/enchantment/Enchantment;registryEntry: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> Lcno;<init>(Lcno$a;Lcnp;[Lbiv;)V
      intermediary <init> Lnet/minecraft/class_1887;<init>(Lnet/minecraft/class_1887$class_1888;Lnet/minecraft/class_1886;[Lnet/minecraft/class_1304;)V
      named <init> Lnet/minecraft/enchantment/Enchantment;<init>(Lnet/minecraft/enchantment/Enchantment$Rarity;Lnet/minecraft/enchantment/EnchantmentTarget;[Lnet/minecraft/entity/EquipmentSlot;)V
  • Method Details

    • byRawId

      @Nullable public static @Nullable Enchantment byRawId(int id)
      Mappings:
      Namespace Name Mixin selector
      official c Lcno;c(I)Lcno;
      intermediary method_8191 Lnet/minecraft/class_1887;method_8191(I)Lnet/minecraft/class_1887;
      named byRawId Lnet/minecraft/enchantment/Enchantment;byRawId(I)Lnet/minecraft/enchantment/Enchantment;
    • getEquipment

      public Map<EquipmentSlot,ItemStack> getEquipment(LivingEntity entity)
      Mappings:
      Namespace Name Mixin selector
      official a Lcno;a(Lbjg;)Ljava/util/Map;
      intermediary method_8185 Lnet/minecraft/class_1887;method_8185(Lnet/minecraft/class_1309;)Ljava/util/Map;
      named getEquipment Lnet/minecraft/enchantment/Enchantment;getEquipment(Lnet/minecraft/entity/LivingEntity;)Ljava/util/Map;
    • getRarity

      public Enchantment.Rarity getRarity()
      Mappings:
      Namespace Name Mixin selector
      official d Lcno;d()Lcno$a;
      intermediary method_8186 Lnet/minecraft/class_1887;method_8186()Lnet/minecraft/class_1887$class_1888;
      named getRarity Lnet/minecraft/enchantment/Enchantment;getRarity()Lnet/minecraft/enchantment/Enchantment$Rarity;
    • getMinLevel

      public int getMinLevel()
      Mappings:
      Namespace Name Mixin selector
      official e Lcno;e()I
      intermediary method_8187 Lnet/minecraft/class_1887;method_8187()I
      named getMinLevel Lnet/minecraft/enchantment/Enchantment;getMinLevel()I
    • getMaxLevel

      public int getMaxLevel()
      Mappings:
      Namespace Name Mixin selector
      official a Lcno;a()I
      intermediary method_8183 Lnet/minecraft/class_1887;method_8183()I
      named getMaxLevel Lnet/minecraft/enchantment/Enchantment;getMaxLevel()I
    • getMinPower

      public int getMinPower(int level)
      Mappings:
      Namespace Name Mixin selector
      official a Lcno;a(I)I
      intermediary method_8182 Lnet/minecraft/class_1887;method_8182(I)I
      named getMinPower Lnet/minecraft/enchantment/Enchantment;getMinPower(I)I
    • getMaxPower

      public int getMaxPower(int level)
      Mappings:
      Namespace Name Mixin selector
      official b Lcno;b(I)I
      intermediary method_20742 Lnet/minecraft/class_1887;method_20742(I)I
      named getMaxPower Lnet/minecraft/enchantment/Enchantment;getMaxPower(I)I
    • getProtectionAmount

      public int getProtectionAmount(int level, DamageSource source)
      Mappings:
      Namespace Name Mixin selector
      official a Lcno;a(ILbho;)I
      intermediary method_8181 Lnet/minecraft/class_1887;method_8181(ILnet/minecraft/class_1282;)I
      named getProtectionAmount Lnet/minecraft/enchantment/Enchantment;getProtectionAmount(ILnet/minecraft/entity/damage/DamageSource;)I
    • getAttackDamage

      public float getAttackDamage(int level, EntityGroup group)
      Mappings:
      Namespace Name Mixin selector
      official a Lcno;a(ILbjl;)F
      intermediary method_8196 Lnet/minecraft/class_1887;method_8196(ILnet/minecraft/class_1310;)F
      named getAttackDamage Lnet/minecraft/enchantment/Enchantment;getAttackDamage(ILnet/minecraft/entity/EntityGroup;)F
    • canCombine

      public final boolean canCombine(Enchantment other)
      Returns whether this enchantment can exist on an item stack with the other enchantment and the other enchantment can exist with this enchantment.
      Returns:
      whether this enchantment can exist on an item stack with the other enchantment and the other enchantment can exist with this enchantment
      Mappings:
      Namespace Name Mixin selector
      official b Lcno;b(Lcno;)Z
      intermediary method_8188 Lnet/minecraft/class_1887;method_8188(Lnet/minecraft/class_1887;)Z
      named canCombine Lnet/minecraft/enchantment/Enchantment;canCombine(Lnet/minecraft/enchantment/Enchantment;)Z
    • canAccept

      protected boolean canAccept(Enchantment other)
      Returns whether this enchantment can exist on an item stack with the other enchantment.
      Returns:
      whether this enchantment can exist on an item stack with the other enchantment
      Mappings:
      Namespace Name Mixin selector
      official a Lcno;a(Lcno;)Z
      intermediary method_8180 Lnet/minecraft/class_1887;method_8180(Lnet/minecraft/class_1887;)Z
      named canAccept Lnet/minecraft/enchantment/Enchantment;canAccept(Lnet/minecraft/enchantment/Enchantment;)Z
    • getOrCreateTranslationKey

      protected String getOrCreateTranslationKey()
      Mappings:
      Namespace Name Mixin selector
      official f Lcno;f()Ljava/lang/String;
      intermediary method_8190 Lnet/minecraft/class_1887;method_8190()Ljava/lang/String;
      named getOrCreateTranslationKey Lnet/minecraft/enchantment/Enchantment;getOrCreateTranslationKey()Ljava/lang/String;
    • getTranslationKey

      public String getTranslationKey()
      Mappings:
      Namespace Name Mixin selector
      official g Lcno;g()Ljava/lang/String;
      intermediary method_8184 Lnet/minecraft/class_1887;method_8184()Ljava/lang/String;
      named getTranslationKey Lnet/minecraft/enchantment/Enchantment;getTranslationKey()Ljava/lang/String;
    • getName

      public Text getName(int level)
      Mappings:
      Namespace Name Mixin selector
      official d Lcno;d(I)Ltl;
      intermediary method_8179 Lnet/minecraft/class_1887;method_8179(I)Lnet/minecraft/class_2561;
      named getName Lnet/minecraft/enchantment/Enchantment;getName(I)Lnet/minecraft/text/Text;
    • isAcceptableItem

      public boolean isAcceptableItem(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      official a Lcno;a(Lcjf;)Z
      intermediary method_8192 Lnet/minecraft/class_1887;method_8192(Lnet/minecraft/class_1799;)Z
      named isAcceptableItem Lnet/minecraft/enchantment/Enchantment;isAcceptableItem(Lnet/minecraft/item/ItemStack;)Z
    • onTargetDamaged

      public void onTargetDamaged(LivingEntity user, Entity target, int level)
      Mappings:
      Namespace Name Mixin selector
      official a Lcno;a(Lbjg;Lbiq;I)V
      intermediary method_8189 Lnet/minecraft/class_1887;method_8189(Lnet/minecraft/class_1309;Lnet/minecraft/class_1297;I)V
      named onTargetDamaged Lnet/minecraft/enchantment/Enchantment;onTargetDamaged(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/Entity;I)V
    • onUserDamaged

      public void onUserDamaged(LivingEntity user, Entity attacker, int level)
      Mappings:
      Namespace Name Mixin selector
      official b Lcno;b(Lbjg;Lbiq;I)V
      intermediary method_8178 Lnet/minecraft/class_1887;method_8178(Lnet/minecraft/class_1309;Lnet/minecraft/class_1297;I)V
      named onUserDamaged Lnet/minecraft/enchantment/Enchantment;onUserDamaged(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/Entity;I)V
    • isTreasure

      public boolean isTreasure()
      Mappings:
      Namespace Name Mixin selector
      official b Lcno;b()Z
      intermediary method_8193 Lnet/minecraft/class_1887;method_8193()Z
      named isTreasure Lnet/minecraft/enchantment/Enchantment;isTreasure()Z
    • isCursed

      public boolean isCursed()
      Mappings:
      Namespace Name Mixin selector
      official c Lcno;c()Z
      intermediary method_8195 Lnet/minecraft/class_1887;method_8195()Z
      named isCursed Lnet/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 h Lcno;h()Z
      intermediary method_25949 Lnet/minecraft/class_1887;method_25949()Z
      named isAvailableForEnchantedBookOffer Lnet/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 i Lcno;i()Z
      intermediary method_25950 Lnet/minecraft/class_1887;method_25950()Z
      named isAvailableForRandomSelection Lnet/minecraft/enchantment/Enchantment;isAvailableForRandomSelection()Z
    • getRegistryEntry

      @Deprecated public RegistryEntry.Reference<Enchantment> getRegistryEntry()
      Deprecated.
      Mappings:
      Namespace Name Mixin selector
      official j Lcno;j()Lhe$c;
      intermediary method_53216 Lnet/minecraft/class_1887;method_53216()Lnet/minecraft/class_6880$class_6883;
      named getRegistryEntry Lnet/minecraft/enchantment/Enchantment;getRegistryEntry()Lnet/minecraft/registry/entry/RegistryEntry$Reference;