Class EnchantmentDurability

java.lang.Object
net.minecraft.src.Enchantment
net.minecraft.src.EnchantmentDurability

public class EnchantmentDurability extends Enchantment
  • Constructor Details

    • EnchantmentDurability

      protected EnchantmentDurability(int par1, int par2)
  • Method Details

    • getMinEnchantability

      public int getMinEnchantability(int par1)
      Returns the minimal value of enchantability needed on the enchantment level passed.
      Overrides:
      getMinEnchantability in class Enchantment
    • getMaxEnchantability

      public int getMaxEnchantability(int par1)
      Returns the maximum value of enchantability nedded on the enchantment level passed.
      Overrides:
      getMaxEnchantability in class Enchantment
    • getMaxLevel

      public int getMaxLevel()
      Returns the maximum level that the enchantment can have.
      Overrides:
      getMaxLevel in class Enchantment
    • canApply

      public boolean canApply(ItemStack par1ItemStack)
      Overrides:
      canApply in class Enchantment
    • negateDamage

      public static boolean negateDamage(ItemStack par0ItemStack, int par1, Random par2Random)
      Used by ItemStack.attemptDamageItem. Randomly determines if a point of damage should be negated using the enchantment level (par1). If the ItemStack is Armor then there is a flat 60% chance for damage to be negated no matter the enchantment level, otherwise there is a 1-(par/1) chance for damage to be negated.