Package net.minecraft.src
Class EnchantmentDurability
java.lang.Object
net.minecraft.src.Enchantment
net.minecraft.src.EnchantmentDurability
-
Field Summary
Fields inherited from class net.minecraft.src.Enchantment
aquaAffinity, baneOfArthropods, blastProtection, effectId, efficiency, enchantmentsBookList, enchantmentsList, featherFalling, fireAspect, fireProtection, flame, fortune, infinity, knockback, looting, name, power, projectileProtection, protection, punch, respiration, sharpness, silkTouch, smite, thorns, type, unbreaking -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanintgetMaxEnchantability(int par1) Returns the maximum value of enchantability nedded on the enchantment level passed.intReturns the maximum level that the enchantment can have.intgetMinEnchantability(int par1) Returns the minimal value of enchantability needed on the enchantment level passed.static booleannegateDamage(ItemStack par0ItemStack, int par1, Random par2Random) Used by ItemStack.attemptDamageItem.Methods inherited from class net.minecraft.src.Enchantment
calcModifierDamage, calcModifierLiving, canApplyTogether, canBeAppliedByVanillaEnchanter, getMinLevel, getName, getTranslatedName, getWeight, setName
-
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:
getMinEnchantabilityin classEnchantment
-
getMaxEnchantability
public int getMaxEnchantability(int par1) Returns the maximum value of enchantability nedded on the enchantment level passed.- Overrides:
getMaxEnchantabilityin classEnchantment
-
getMaxLevel
public int getMaxLevel()Returns the maximum level that the enchantment can have.- Overrides:
getMaxLevelin classEnchantment
-
canApply
- Overrides:
canApplyin classEnchantment
-
negateDamage
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.
-