Class Enchantment

java.lang.Object
net.minecraft.world.item.enchantment.Enchantment
All Implemented Interfaces:
IForgeEnchantment
Direct Known Subclasses:
ArrowDamageEnchantment, ArrowFireEnchantment, ArrowInfiniteEnchantment, ArrowKnockbackEnchantment, ArrowPiercingEnchantment, BindingCurseEnchantment, DamageEnchantment, DigDurabilityEnchantment, DiggingEnchantment, FireAspectEnchantment, FishingSpeedEnchantment, FrostWalkerEnchantment, KnockbackEnchantment, LootBonusEnchantment, MendingEnchantment, MultiShotEnchantment, OxygenEnchantment, ProtectionEnchantment, QuickChargeEnchantment, SoulSpeedEnchantment, SweepingEdgeEnchantment, SwiftSneakEnchantment, ThornsEnchantment, TridentChannelingEnchantment, TridentImpalerEnchantment, TridentLoyaltyEnchantment, TridentRiptideEnchantment, UntouchingEnchantment, VanishingCurseEnchantment, WaterWalkerEnchantment, WaterWorkerEnchantment

public abstract class Enchantment extends Object implements IForgeEnchantment
  • Field Details

  • Constructor Details

  • Method Details

    • byId

      @Nullable public static Enchantment byId(int p_44698_)
    • getSlotItems

      public Map<EquipmentSlot,ItemStack> getSlotItems(LivingEntity p_44685_)
    • getRarity

      public Enchantment.Rarity getRarity()
    • getMinLevel

      public int getMinLevel()
    • getMaxLevel

      public int getMaxLevel()
    • getMinCost

      public int getMinCost(int p_44679_)
    • getMaxCost

      public int getMaxCost(int p_44691_)
    • getDamageProtection

      public int getDamageProtection(int p_44680_, DamageSource p_44681_)
    • getDamageBonus

      @Deprecated public float getDamageBonus(int p_44682_, MobType p_44683_)
      Deprecated.
    • isCompatibleWith

      public final boolean isCompatibleWith(Enchantment p_44696_)
    • checkCompatibility

      protected boolean checkCompatibility(Enchantment p_44690_)
    • getOrCreateDescriptionId

      protected String getOrCreateDescriptionId()
    • getDescriptionId

      public String getDescriptionId()
    • getFullname

      public Component getFullname(int p_44701_)
    • canEnchant

      public boolean canEnchant(ItemStack p_44689_)
    • doPostAttack

      public void doPostAttack(LivingEntity p_44686_, Entity p_44687_, int p_44688_)
    • doPostHurt

      public void doPostHurt(LivingEntity p_44692_, Entity p_44693_, int p_44694_)
    • isTreasureOnly

      public boolean isTreasureOnly()
    • isCurse

      public boolean isCurse()
    • isTradeable

      public boolean isTradeable()
    • isDiscoverable

      public boolean isDiscoverable()
    • canApplyAtEnchantingTable

      public boolean canApplyAtEnchantingTable(ItemStack stack)
      This applies specifically to applying at the enchanting table. The other method canEnchant(ItemStack) applies for all possible enchantments.
      Parameters:
      stack -
      Returns:
    • isAllowedOnBooks

      public boolean isAllowedOnBooks()
      Is this enchantment allowed to be enchanted on books via Enchantment Table
      Returns:
      false to disable the vanilla feature