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, ThornsEnchantment, UnbreakingEnchantment, VanishingCurseEnchantment

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

    • slotTypes

      private final EquipmentSlot[] slotTypes
      Mappings:
      Namespace Name Mixin selector
      official a Lbuj;a:[Latk;
      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 Lbuj;b:Lbuj$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;
    • type

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

      @Nullable protected @Nullable String translationKey
      Mappings:
      Namespace Name Mixin selector
      official f Lbuj;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;
  • Constructor Details

    • Enchantment

      protected Enchantment(Enchantment.Rarity weight, EnchantmentTarget type, EquipmentSlot[] slotTypes)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lbuj;<init>(Lbuj$a;Lbuk;[Latk;)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 Lbuj;c(I)Lbuj;
      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 Lbuj;a(Latt;)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 Lbuj;d()Lbuj$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 Lbuj;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 Lbuj;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 Lbuj;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 Lbuj;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 Lbuj;a(ILasp;)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 Lbuj;a(ILaty;)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.
      Mappings:
      Namespace Name Mixin selector
      official b Lbuj;b(Lbuj;)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.
      Mappings:
      Namespace Name Mixin selector
      official a Lbuj;a(Lbuj;)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 Lbuj;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 Lbuj;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 Lbuj;d(I)Los;
      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 Lbuj;a(Lbqp;)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 Lbuj;a(Latt;Latf;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 Lbuj;b(Latt;Latf;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 Lbuj;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 Lbuj;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.
      Mappings:
      Namespace Name Mixin selector
      official h Lbuj;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.
      Mappings:
      Namespace Name Mixin selector
      official i Lbuj;i()Z
      intermediary method_25950 Lnet/minecraft/class_1887;method_25950()Z
      named isAvailableForRandomSelection Lnet/minecraft/enchantment/Enchantment;isAvailableForRandomSelection()Z