Package net.minecraft.src
Class Enchantment
java.lang.Object
net.minecraft.src.Enchantment
- Direct Known Subclasses:
EnchantmentArrowDamage,EnchantmentArrowFire,EnchantmentArrowInfinite,EnchantmentArrowKnockback,EnchantmentDamage,EnchantmentDigging,EnchantmentDurability,EnchantmentFireAspect,EnchantmentKnockback,EnchantmentLootBonus,EnchantmentOxygen,EnchantmentProtection,EnchantmentThorns,EnchantmentUntouching,EnchantmentWaterWorker
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EnchantmentIncreases underwater mining ratestatic final EnchantmentExtra damage to spiders, cave spiders and silverfishstatic final EnchantmentProtection against explosionsfinal intstatic final EnchantmentFaster resource gathering while in usestatic final Enchantment[]The list of enchantments applicable by the anvil from a bookstatic final Enchantment[]static final EnchantmentLess fall damagestatic final EnchantmentLights mobs on firestatic final EnchantmentProtection against firestatic final EnchantmentFlame enchantment for bows.static final EnchantmentCan multiply the drop rate of items from blocksstatic final EnchantmentInfinity enchantment for bows.static final EnchantmentKnocks mob and players backwards upon hitstatic final EnchantmentMobs have a chance to drop more lootprotected StringUsed in localisation and stats.static final EnchantmentPower enchantment for bows, add's extra damage to arrows.static final EnchantmentProtection against projectile entities (e.g. arrows)static final EnchantmentConverts environmental damage to armour damagestatic final EnchantmentKnockback enchantments for bows, the arrows will knockback the target when hit.static final EnchantmentDecreases the rate of air loss underwater; increases time between damage while suffocatingstatic final EnchantmentExtra damage to mobsstatic final EnchantmentBlocks mined will drop themselves, even if it should drop something else (e.g. stone will drop stone, not cobblestone)static final EnchantmentExtra damage to zombies, zombie pigmen and skeletonsstatic final EnchantmentThe EnumEnchantmentType given to this Enchantment.static final EnchantmentSometimes, the tool's durability will not be spent when the tool is used -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEnchantment(int par1, int par2, EnumEnchantmentType par3EnumEnchantmentType) -
Method Summary
Modifier and TypeMethodDescriptionintcalcModifierDamage(int par1, DamageSource par2DamageSource) Calculates de damage protection of the enchantment based on level and damage source passed.floatcalcModifierLiving(int par1, EntityLivingBase par2EntityLivingBase) Calculates de (magic) damage done by the enchantment on a living entity based on level and entity passed.booleanbooleancanApplyTogether(Enchantment par1Enchantment) Determines if the enchantment passed can be applyied together with this enchantment.booleanintgetMaxEnchantability(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.intReturns the minimum level that the enchantment can have.getName()Return the name of key in translation table of this enchantment.getTranslatedName(int par1) Returns the correct traslated name of the enchantment and the level in roman numbers.intSets the enchantment name
-
Field Details
-
enchantmentsList
-
enchantmentsBookList
The list of enchantments applicable by the anvil from a book -
protection
Converts environmental damage to armour damage -
fireProtection
Protection against fire -
featherFalling
Less fall damage -
blastProtection
Protection against explosions -
projectileProtection
Protection against projectile entities (e.g. arrows) -
respiration
Decreases the rate of air loss underwater; increases time between damage while suffocating -
aquaAffinity
Increases underwater mining rate -
thorns
-
sharpness
Extra damage to mobs -
smite
Extra damage to zombies, zombie pigmen and skeletons -
baneOfArthropods
Extra damage to spiders, cave spiders and silverfish -
knockback
Knocks mob and players backwards upon hit -
fireAspect
Lights mobs on fire -
looting
Mobs have a chance to drop more loot -
efficiency
Faster resource gathering while in use -
silkTouch
Blocks mined will drop themselves, even if it should drop something else (e.g. stone will drop stone, not cobblestone) -
unbreaking
Sometimes, the tool's durability will not be spent when the tool is used -
fortune
Can multiply the drop rate of items from blocks -
power
Power enchantment for bows, add's extra damage to arrows. -
punch
Knockback enchantments for bows, the arrows will knockback the target when hit. -
flame
Flame enchantment for bows. Arrows fired by the bow will be on fire. Any target hit will also set on fire. -
infinity
Infinity enchantment for bows. The bow will not consume arrows anymore, but will still required at least one arrow on inventory use the bow. -
effectId
public final int effectId -
type
The EnumEnchantmentType given to this Enchantment. -
name
Used in localisation and stats.
-
-
Constructor Details
-
Enchantment
-
-
Method Details
-
getWeight
public int getWeight() -
getMinLevel
public int getMinLevel()Returns the minimum level that the enchantment can have. -
getMaxLevel
public int getMaxLevel()Returns the maximum level that the enchantment can have. -
getMinEnchantability
public int getMinEnchantability(int par1) Returns the minimal value of enchantability needed on the enchantment level passed. -
getMaxEnchantability
public int getMaxEnchantability(int par1) Returns the maximum value of enchantability nedded on the enchantment level passed. -
calcModifierDamage
Calculates de damage protection of the enchantment based on level and damage source passed. -
calcModifierLiving
Calculates de (magic) damage done by the enchantment on a living entity based on level and entity passed. -
canApplyTogether
Determines if the enchantment passed can be applyied together with this enchantment. -
setName
Sets the enchantment name -
getName
Return the name of key in translation table of this enchantment. -
getTranslatedName
Returns the correct traslated name of the enchantment and the level in roman numbers. -
canApply
-
canBeAppliedByVanillaEnchanter
public boolean canBeAppliedByVanillaEnchanter()
-