Class Enchantment

java.lang.Object
net.minecraft.enchantment.Enchantment
Direct Known Subclasses:
AquaAffinityEnchantment, BetterLootEnchantment, DamageEnchantment, DepthStriderEnchantment, EfficiencyEnchantment, FireAspectEnchantment, FlameEnchantment, InfinityEnchantment, KnockbackEnchantment, LureEnchantment, PowerEnchantment, ProtectionEnchantment, PunchEnchantment, RespirationEnchantment, SilkTouchEnchantment, ThornsEnchantment, UnbreakingEnchantment

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

    • ENCHANTMENTS

      private static final Enchantment[] ENCHANTMENTS
      Mappings:
      Namespace Name Mixin selector
      official a Lapf;a:[Lapf;
      intermediary field_9167 Lnet/minecraft/class_1127;field_9167:[Lnet/minecraft/class_1127;
      named ENCHANTMENTS Lnet/minecraft/enchantment/Enchantment;ENCHANTMENTS:[Lnet/minecraft/enchantment/Enchantment;
    • ALL_ENCHANTMENTS

      public static final Enchantment[] ALL_ENCHANTMENTS
      Mappings:
      Namespace Name Mixin selector
      official b Lapf;b:[Lapf;
      intermediary field_4454 Lnet/minecraft/class_1127;field_4454:[Lnet/minecraft/class_1127;
      named ALL_ENCHANTMENTS Lnet/minecraft/enchantment/Enchantment;ALL_ENCHANTMENTS:[Lnet/minecraft/enchantment/Enchantment;
    • ENCHANTMENT_MAP

      private static final Map ENCHANTMENT_MAP
      Mappings:
      Namespace Name Mixin selector
      official E Lapf;E:Ljava/util/Map;
      intermediary field_9166 Lnet/minecraft/class_1127;field_9166:Ljava/util/Map;
      named ENCHANTMENT_MAP Lnet/minecraft/enchantment/Enchantment;ENCHANTMENT_MAP:Ljava/util/Map;
    • PROTECTION

      public static final Enchantment PROTECTION
      Mappings:
      Namespace Name Mixin selector
      official c Lapf;c:Lapf;
      intermediary field_9168 Lnet/minecraft/class_1127;field_9168:Lnet/minecraft/class_1127;
      named PROTECTION Lnet/minecraft/enchantment/Enchantment;PROTECTION:Lnet/minecraft/enchantment/Enchantment;
    • FIRE_PROTECTION

      public static final Enchantment FIRE_PROTECTION
      Mappings:
      Namespace Name Mixin selector
      official d Lapf;d:Lapf;
      intermediary field_4456 Lnet/minecraft/class_1127;field_4456:Lnet/minecraft/class_1127;
      named FIRE_PROTECTION Lnet/minecraft/enchantment/Enchantment;FIRE_PROTECTION:Lnet/minecraft/enchantment/Enchantment;
    • FEATHER_FALLING

      public static final Enchantment FEATHER_FALLING
      Mappings:
      Namespace Name Mixin selector
      official e Lapf;e:Lapf;
      intermediary field_9169 Lnet/minecraft/class_1127;field_9169:Lnet/minecraft/class_1127;
      named FEATHER_FALLING Lnet/minecraft/enchantment/Enchantment;FEATHER_FALLING:Lnet/minecraft/enchantment/Enchantment;
    • BLAST_PROTECTION

      public static final Enchantment BLAST_PROTECTION
      Mappings:
      Namespace Name Mixin selector
      official f Lapf;f:Lapf;
      intermediary field_4458 Lnet/minecraft/class_1127;field_4458:Lnet/minecraft/class_1127;
      named BLAST_PROTECTION Lnet/minecraft/enchantment/Enchantment;BLAST_PROTECTION:Lnet/minecraft/enchantment/Enchantment;
    • PROJECTILE_PROTECTION

      public static final Enchantment PROJECTILE_PROTECTION
      Mappings:
      Namespace Name Mixin selector
      official g Lapf;g:Lapf;
      intermediary field_9170 Lnet/minecraft/class_1127;field_9170:Lnet/minecraft/class_1127;
      named PROJECTILE_PROTECTION Lnet/minecraft/enchantment/Enchantment;PROJECTILE_PROTECTION:Lnet/minecraft/enchantment/Enchantment;
    • RESPIRATION

      public static final Enchantment RESPIRATION
      Mappings:
      Namespace Name Mixin selector
      official h Lapf;h:Lapf;
      intermediary field_9171 Lnet/minecraft/class_1127;field_9171:Lnet/minecraft/class_1127;
      named RESPIRATION Lnet/minecraft/enchantment/Enchantment;RESPIRATION:Lnet/minecraft/enchantment/Enchantment;
    • AQUA_AFFINITY

      public static final Enchantment AQUA_AFFINITY
      Mappings:
      Namespace Name Mixin selector
      official i Lapf;i:Lapf;
      intermediary field_4461 Lnet/minecraft/class_1127;field_4461:Lnet/minecraft/class_1127;
      named AQUA_AFFINITY Lnet/minecraft/enchantment/Enchantment;AQUA_AFFINITY:Lnet/minecraft/enchantment/Enchantment;
    • THORNS

      public static final Enchantment THORNS
      Mappings:
      Namespace Name Mixin selector
      official j Lapf;j:Lapf;
      intermediary field_5458 Lnet/minecraft/class_1127;field_5458:Lnet/minecraft/class_1127;
      named THORNS Lnet/minecraft/enchantment/Enchantment;THORNS:Lnet/minecraft/enchantment/Enchantment;
    • DEPTH_STRIDER

      public static final Enchantment DEPTH_STRIDER
      Mappings:
      Namespace Name Mixin selector
      official k Lapf;k:Lapf;
      intermediary field_9172 Lnet/minecraft/class_1127;field_9172:Lnet/minecraft/class_1127;
      named DEPTH_STRIDER Lnet/minecraft/enchantment/Enchantment;DEPTH_STRIDER:Lnet/minecraft/enchantment/Enchantment;
    • SHARPNESS

      public static final Enchantment SHARPNESS
      Mappings:
      Namespace Name Mixin selector
      official l Lapf;l:Lapf;
      intermediary field_9173 Lnet/minecraft/class_1127;field_9173:Lnet/minecraft/class_1127;
      named SHARPNESS Lnet/minecraft/enchantment/Enchantment;SHARPNESS:Lnet/minecraft/enchantment/Enchantment;
    • SMITE

      public static final Enchantment SMITE
      Mappings:
      Namespace Name Mixin selector
      official m Lapf;m:Lapf;
      intermediary field_9174 Lnet/minecraft/class_1127;field_9174:Lnet/minecraft/class_1127;
      named SMITE Lnet/minecraft/enchantment/Enchantment;SMITE:Lnet/minecraft/enchantment/Enchantment;
    • BANE_OF_ARTHROPODS

      public static final Enchantment BANE_OF_ARTHROPODS
      Mappings:
      Namespace Name Mixin selector
      official n Lapf;n:Lapf;
      intermediary field_9175 Lnet/minecraft/class_1127;field_9175:Lnet/minecraft/class_1127;
      named BANE_OF_ARTHROPODS Lnet/minecraft/enchantment/Enchantment;BANE_OF_ARTHROPODS:Lnet/minecraft/enchantment/Enchantment;
    • KNOCKBACK

      public static final Enchantment KNOCKBACK
      Mappings:
      Namespace Name Mixin selector
      official o Lapf;o:Lapf;
      intermediary field_9176 Lnet/minecraft/class_1127;field_9176:Lnet/minecraft/class_1127;
      named KNOCKBACK Lnet/minecraft/enchantment/Enchantment;KNOCKBACK:Lnet/minecraft/enchantment/Enchantment;
    • FIRE_ASPECT

      public static final Enchantment FIRE_ASPECT
      Mappings:
      Namespace Name Mixin selector
      official p Lapf;p:Lapf;
      intermediary field_4466 Lnet/minecraft/class_1127;field_4466:Lnet/minecraft/class_1127;
      named FIRE_ASPECT Lnet/minecraft/enchantment/Enchantment;FIRE_ASPECT:Lnet/minecraft/enchantment/Enchantment;
    • LOOTING

      public static final Enchantment LOOTING
      Mappings:
      Namespace Name Mixin selector
      official q Lapf;q:Lapf;
      intermediary field_4467 Lnet/minecraft/class_1127;field_4467:Lnet/minecraft/class_1127;
      named LOOTING Lnet/minecraft/enchantment/Enchantment;LOOTING:Lnet/minecraft/enchantment/Enchantment;
    • EFFICIENCY

      public static final Enchantment EFFICIENCY
      Mappings:
      Namespace Name Mixin selector
      official r Lapf;r:Lapf;
      intermediary field_4468 Lnet/minecraft/class_1127;field_4468:Lnet/minecraft/class_1127;
      named EFFICIENCY Lnet/minecraft/enchantment/Enchantment;EFFICIENCY:Lnet/minecraft/enchantment/Enchantment;
    • SILK_TOUCH

      public static final Enchantment SILK_TOUCH
      Mappings:
      Namespace Name Mixin selector
      official s Lapf;s:Lapf;
      intermediary field_4469 Lnet/minecraft/class_1127;field_4469:Lnet/minecraft/class_1127;
      named SILK_TOUCH Lnet/minecraft/enchantment/Enchantment;SILK_TOUCH:Lnet/minecraft/enchantment/Enchantment;
    • UNBREAKING

      public static final Enchantment UNBREAKING
      Mappings:
      Namespace Name Mixin selector
      official t Lapf;t:Lapf;
      intermediary field_4470 Lnet/minecraft/class_1127;field_4470:Lnet/minecraft/class_1127;
      named UNBREAKING Lnet/minecraft/enchantment/Enchantment;UNBREAKING:Lnet/minecraft/enchantment/Enchantment;
    • FORTUNE

      public static final Enchantment FORTUNE
      Mappings:
      Namespace Name Mixin selector
      official u Lapf;u:Lapf;
      intermediary field_4471 Lnet/minecraft/class_1127;field_4471:Lnet/minecraft/class_1127;
      named FORTUNE Lnet/minecraft/enchantment/Enchantment;FORTUNE:Lnet/minecraft/enchantment/Enchantment;
    • POWER

      public static final Enchantment POWER
      Mappings:
      Namespace Name Mixin selector
      official v Lapf;v:Lapf;
      intermediary field_4472 Lnet/minecraft/class_1127;field_4472:Lnet/minecraft/class_1127;
      named POWER Lnet/minecraft/enchantment/Enchantment;POWER:Lnet/minecraft/enchantment/Enchantment;
    • PUNCH

      public static final Enchantment PUNCH
      Mappings:
      Namespace Name Mixin selector
      official w Lapf;w:Lapf;
      intermediary field_4473 Lnet/minecraft/class_1127;field_4473:Lnet/minecraft/class_1127;
      named PUNCH Lnet/minecraft/enchantment/Enchantment;PUNCH:Lnet/minecraft/enchantment/Enchantment;
    • FLAME

      public static final Enchantment FLAME
      Mappings:
      Namespace Name Mixin selector
      official x Lapf;x:Lapf;
      intermediary field_4474 Lnet/minecraft/class_1127;field_4474:Lnet/minecraft/class_1127;
      named FLAME Lnet/minecraft/enchantment/Enchantment;FLAME:Lnet/minecraft/enchantment/Enchantment;
    • INIFINITY

      public static final Enchantment INIFINITY
      Mappings:
      Namespace Name Mixin selector
      official y Lapf;y:Lapf;
      intermediary field_4475 Lnet/minecraft/class_1127;field_4475:Lnet/minecraft/class_1127;
      named INIFINITY Lnet/minecraft/enchantment/Enchantment;INIFINITY:Lnet/minecraft/enchantment/Enchantment;
    • LUCK_OF_THE_SEA

      public static final Enchantment LUCK_OF_THE_SEA
      Mappings:
      Namespace Name Mixin selector
      official z Lapf;z:Lapf;
      intermediary field_7156 Lnet/minecraft/class_1127;field_7156:Lnet/minecraft/class_1127;
      named LUCK_OF_THE_SEA Lnet/minecraft/enchantment/Enchantment;LUCK_OF_THE_SEA:Lnet/minecraft/enchantment/Enchantment;
    • LURE

      public static final Enchantment LURE
      Mappings:
      Namespace Name Mixin selector
      official A Lapf;A:Lapf;
      intermediary field_7155 Lnet/minecraft/class_1127;field_7155:Lnet/minecraft/class_1127;
      named LURE Lnet/minecraft/enchantment/Enchantment;LURE:Lnet/minecraft/enchantment/Enchantment;
    • id

      public final int id
      Mappings:
      Namespace Name Mixin selector
      official B Lapf;B:I
      intermediary field_4476 Lnet/minecraft/class_1127;field_4476:I
      named id Lnet/minecraft/enchantment/Enchantment;id:I
    • enchantmentType

      private final int enchantmentType
      Mappings:
      Namespace Name Mixin selector
      official F Lapf;F:I
      intermediary field_4453 Lnet/minecraft/class_1127;field_4453:I
      named enchantmentType Lnet/minecraft/enchantment/Enchantment;enchantmentType:I
    • target

      public EnchantmentTarget target
      Mappings:
      Namespace Name Mixin selector
      official C Lapf;C:Lapg;
      intermediary field_4477 Lnet/minecraft/class_1127;field_4477:Lnet/minecraft/class_1128;
      named target Lnet/minecraft/enchantment/Enchantment;target:Lnet/minecraft/enchantment/EnchantmentTarget;
    • translationKey

      protected String translationKey
      Mappings:
      Namespace Name Mixin selector
      official D Lapf;D:Ljava/lang/String;
      intermediary field_4478 Lnet/minecraft/class_1127;field_4478:Ljava/lang/String;
      named translationKey Lnet/minecraft/enchantment/Enchantment;translationKey:Ljava/lang/String;
  • Constructor Details

    • Enchantment

      protected Enchantment(int id, Identifier identifier, int enchantmentType, EnchantmentTarget target)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lapf;<init>(ILoa;ILapg;)V
      intermediary <init> Lnet/minecraft/class_1127;<init>(ILnet/minecraft/class_1653;ILnet/minecraft/class_1128;)V
      named <init> Lnet/minecraft/enchantment/Enchantment;<init>(ILnet/minecraft/util/Identifier;ILnet/minecraft/enchantment/EnchantmentTarget;)V
  • Method Details

    • byRawId

      public static Enchantment byRawId(int id)
      Mappings:
      Namespace Name Mixin selector
      official c Lapf;c(I)Lapf;
      intermediary method_8448 Lnet/minecraft/class_1127;method_8448(I)Lnet/minecraft/class_1127;
      named byRawId Lnet/minecraft/enchantment/Enchantment;byRawId(I)Lnet/minecraft/enchantment/Enchantment;
    • getByName

      public static Enchantment getByName(String name)
      Mappings:
      Namespace Name Mixin selector
      official b Lapf;b(Ljava/lang/String;)Lapf;
      intermediary method_8446 Lnet/minecraft/class_1127;method_8446(Ljava/lang/String;)Lnet/minecraft/class_1127;
      named getByName Lnet/minecraft/enchantment/Enchantment;getByName(Ljava/lang/String;)Lnet/minecraft/enchantment/Enchantment;
    • method_8447

      public static String[] method_8447()
      Mappings:
      Namespace Name Mixin selector
      official c Lapf;c()[Ljava/lang/String;
      intermediary method_8447 Lnet/minecraft/class_1127;method_8447()[Ljava/lang/String;
      named method_8447 Lnet/minecraft/enchantment/Enchantment;method_8447()[Ljava/lang/String;
    • getEnchantmentType

      public int getEnchantmentType()
      Mappings:
      Namespace Name Mixin selector
      official d Lapf;d()I
      intermediary method_3515 Lnet/minecraft/class_1127;method_3515()I
      named getEnchantmentType Lnet/minecraft/enchantment/Enchantment;getEnchantmentType()I
    • getMinimumLevel

      public int getMinimumLevel()
      Mappings:
      Namespace Name Mixin selector
      official e Lapf;e()I
      intermediary method_3517 Lnet/minecraft/class_1127;method_3517()I
      named getMinimumLevel Lnet/minecraft/enchantment/Enchantment;getMinimumLevel()I
    • getMaximumLevel

      public int getMaximumLevel()
      Mappings:
      Namespace Name Mixin selector
      official b Lapf;b()I
      intermediary method_3512 Lnet/minecraft/class_1127;method_3512()I
      named getMaximumLevel Lnet/minecraft/enchantment/Enchantment;getMaximumLevel()I
    • getMinimumPower

      public int getMinimumPower(int level)
      Mappings:
      Namespace Name Mixin selector
      official a Lapf;a(I)I
      intermediary method_3508 Lnet/minecraft/class_1127;method_3508(I)I
      named getMinimumPower Lnet/minecraft/enchantment/Enchantment;getMinimumPower(I)I
    • getMaximumPower

      public int getMaximumPower(int level)
      Mappings:
      Namespace Name Mixin selector
      official b Lapf;b(I)I
      intermediary method_3513 Lnet/minecraft/class_1127;method_3513(I)I
      named getMaximumPower Lnet/minecraft/enchantment/Enchantment;getMaximumPower(I)I
    • getProtectionAmount

      public int getProtectionAmount(int level, DamageSource source)
      Mappings:
      Namespace Name Mixin selector
      official a Lapf;a(ILwh;)I
      intermediary method_3509 Lnet/minecraft/class_1127;method_3509(ILnet/minecraft/class_856;)I
      named getProtectionAmount Lnet/minecraft/enchantment/Enchantment;getProtectionAmount(ILnet/minecraft/entity/damage/DamageSource;)I
    • getDamageModifier

      public float getDamageModifier(int index, EntityGroup target)
      Mappings:
      Namespace Name Mixin selector
      official a Lapf;a(ILxs;)F
      intermediary method_5489 Lnet/minecraft/class_1127;method_5489(ILnet/minecraft/class_873;)F
      named getDamageModifier Lnet/minecraft/enchantment/Enchantment;getDamageModifier(ILnet/minecraft/entity/EntityGroup;)F
    • differs

      public boolean differs(Enchantment other)
      Mappings:
      Namespace Name Mixin selector
      official a Lapf;a(Lapf;)Z
      intermediary method_3511 Lnet/minecraft/class_1127;method_3511(Lnet/minecraft/class_1127;)Z
      named differs Lnet/minecraft/enchantment/Enchantment;differs(Lnet/minecraft/enchantment/Enchantment;)Z
    • setName

      public Enchantment setName(String translationKey)
      Mappings:
      Namespace Name Mixin selector
      official c Lapf;c(Ljava/lang/String;)Lapf;
      intermediary method_3514 Lnet/minecraft/class_1127;method_3514(Ljava/lang/String;)Lnet/minecraft/class_1127;
      named setName Lnet/minecraft/enchantment/Enchantment;setName(Ljava/lang/String;)Lnet/minecraft/enchantment/Enchantment;
    • getTranslationKey

      public String getTranslationKey()
      Mappings:
      Namespace Name Mixin selector
      official a Lapf;a()Ljava/lang/String;
      intermediary method_3507 Lnet/minecraft/class_1127;method_3507()Ljava/lang/String;
      named getTranslationKey Lnet/minecraft/enchantment/Enchantment;getTranslationKey()Ljava/lang/String;
    • getTranslatedName

      public String getTranslatedName(int level)
      Mappings:
      Namespace Name Mixin selector
      official d Lapf;d(I)Ljava/lang/String;
      intermediary method_3516 Lnet/minecraft/class_1127;method_3516(I)Ljava/lang/String;
      named getTranslatedName Lnet/minecraft/enchantment/Enchantment;getTranslatedName(I)Ljava/lang/String;
    • isAcceptableItem

      public boolean isAcceptableItem(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      official a Lapf;a(Lamj;)Z
      intermediary method_4644 Lnet/minecraft/class_1127;method_4644(Lnet/minecraft/class_1071;)Z
      named isAcceptableItem Lnet/minecraft/enchantment/Enchantment;isAcceptableItem(Lnet/minecraft/item/ItemStack;)Z
    • onDamage

      public void onDamage(LivingEntity livingEntity, Entity entity, int power)
      Mappings:
      Namespace Name Mixin selector
      official a Lapf;a(Lxm;Lwv;I)V
      intermediary method_6381 Lnet/minecraft/class_1127;method_6381(Lnet/minecraft/class_1699;Lnet/minecraft/class_864;I)V
      named onDamage Lnet/minecraft/enchantment/Enchantment;onDamage(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/Entity;I)V
    • onDamaged

      public void onDamaged(LivingEntity livingEntity, Entity entity, int power)
      Mappings:
      Namespace Name Mixin selector
      official b Lapf;b(Lxm;Lwv;I)V
      intermediary method_6382 Lnet/minecraft/class_1127;method_6382(Lnet/minecraft/class_1699;Lnet/minecraft/class_864;I)V
      named onDamaged Lnet/minecraft/enchantment/Enchantment;onDamaged(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/Entity;I)V