public class EnchantmentDamage extends Enchantment
Modifier and Type | Field and Description |
---|---|
private static int[] |
baseEnchantability
Holds the base factor of enchantability needed to be able to use the enchant.
|
int |
damageType
Defines the type of damage of the enchantment, 0 = all, 1 = undead, 3 = arthropods
|
private static int[] |
levelEnchantability
Holds how much each level increased the enchantability factor to be able to use this enchant.
|
private static java.lang.String[] |
protectionName
Holds the name to be translated of each protection type.
|
private static int[] |
thresholdEnchantability
Used on the formula of base enchantability, this is the 'window' factor of values to be able to use thing
enchant.
|
aquaAffinity, baneOfArthropods, blastProtection, depthStrider, effectId, efficiency, enchantmentsBookList, featherFalling, fireAspect, fireProtection, flame, fortune, infinity, knockback, looting, luckOfTheSea, lure, name, power, projectileProtection, protection, punch, respiration, sharpness, silkTouch, smite, thorns, type, unbreaking
Constructor and Description |
---|
EnchantmentDamage(int enchID,
ResourceLocation enchName,
int enchWeight,
int classification) |
Modifier and Type | Method and Description |
---|---|
float |
calcDamageByCreature(int level,
EnumCreatureAttribute creatureType)
Calculates the additional damage that will be dealt by an item with this enchantment.
|
boolean |
canApply(ItemStack stack)
Determines if this enchantment can be applied to a specific ItemStack.
|
boolean |
canApplyTogether(Enchantment ench)
Determines if the enchantment passed can be applyied together with this enchantment.
|
int |
getMaxEnchantability(int enchantmentLevel)
Returns the maximum value of enchantability nedded on the enchantment level passed.
|
int |
getMaxLevel()
Returns the maximum level that the enchantment can have.
|
int |
getMinEnchantability(int enchantmentLevel)
Returns the minimal value of enchantability needed on the enchantment level passed.
|
java.lang.String |
getName()
Return the name of key in translation table of this enchantment.
|
void |
onEntityDamaged(EntityLivingBase user,
Entity target,
int level)
Called whenever a mob is damaged with an item that has this enchantment on it.
|
calcModifierDamage, func_181077_c, getEnchantmentById, getEnchantmentByLocation, getMinLevel, getTranslatedName, getWeight, onUserHurt, setName
private static final java.lang.String[] protectionName
private static final int[] baseEnchantability
private static final int[] levelEnchantability
private static final int[] thresholdEnchantability
public final int damageType
public EnchantmentDamage(int enchID, ResourceLocation enchName, int enchWeight, int classification)
public int getMinEnchantability(int enchantmentLevel)
getMinEnchantability
in class Enchantment
public int getMaxEnchantability(int enchantmentLevel)
getMaxEnchantability
in class Enchantment
public int getMaxLevel()
getMaxLevel
in class Enchantment
public float calcDamageByCreature(int level, EnumCreatureAttribute creatureType)
calcDamageByCreature
in class Enchantment
public java.lang.String getName()
getName
in class Enchantment
public boolean canApplyTogether(Enchantment ench)
canApplyTogether
in class Enchantment
public boolean canApply(ItemStack stack)
canApply
in class Enchantment
public void onEntityDamaged(EntityLivingBase user, Entity target, int level)
onEntityDamaged
in class Enchantment