public abstract class Enchantment
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Enchantment |
aquaAffinity
Increases underwater mining rate
|
static Enchantment |
baneOfArthropods |
static Enchantment |
blastProtection
Protection against explosions
|
static Enchantment |
depthStrider |
int |
effectId |
static Enchantment |
efficiency
Faster resource gathering while in use
|
static Enchantment[] |
enchantmentsBookList |
static Enchantment |
featherFalling |
static Enchantment |
fireAspect
Lights mobs on fire
|
static Enchantment |
fireProtection
Protection against fire
|
static Enchantment |
flame
Flame enchantment for bows.
|
static Enchantment |
fortune
Can multiply the drop rate of items from blocks
|
static Enchantment |
infinity
Infinity enchantment for bows.
|
static Enchantment |
knockback |
static Enchantment |
looting
Mobs have a chance to drop more loot
|
static Enchantment |
luckOfTheSea |
static Enchantment |
lure |
protected java.lang.String |
name
Used in localisation and stats.
|
static Enchantment |
power
Power enchantment for bows, add's extra damage to arrows.
|
static Enchantment |
projectileProtection |
static Enchantment |
protection |
static Enchantment |
punch
Knockback enchantments for bows, the arrows will knockback the target when hit.
|
static Enchantment |
respiration |
static Enchantment |
sharpness |
static Enchantment |
silkTouch
Blocks mined will drop themselves, even if it should drop something else (e.g. stone will drop stone, not
cobblestone)
|
static Enchantment |
smite |
static Enchantment |
thorns |
EnumEnchantmentType |
type
The EnumEnchantmentType given to this Enchantment.
|
static Enchantment |
unbreaking
Sometimes, the tool's durability will not be spent when the tool is used
|
Modifier | Constructor and Description |
---|---|
protected |
Enchantment(int enchID,
ResourceLocation enchName,
int enchWeight,
EnumEnchantmentType enchType) |
Modifier and Type | Method and Description |
---|---|
static void |
addToBookList(Enchantment enchantment)
Add to the list of enchantments applicable by the anvil from a book
|
float |
calcDamageByCreature(int level,
EnumCreatureAttribute creatureType)
Calculates the additional damage that will be dealt by an item with this enchantment.
|
int |
calcModifierDamage(int level,
DamageSource source)
Calculates the damage protection of the enchantment based on level and damage source passed.
|
boolean |
canApply(ItemStack stack)
Determines if this enchantment can be applied to a specific ItemStack.
|
boolean |
canApplyAtEnchantingTable(ItemStack stack)
This applies specifically to applying at the enchanting table.
|
boolean |
canApplyTogether(Enchantment ench)
Determines if the enchantment passed can be applyied together with this enchantment.
|
static java.util.Set<ResourceLocation> |
func_181077_c() |
static Enchantment |
getEnchantmentById(int enchID)
Retrieves an Enchantment from the enchantmentsList
|
static Enchantment |
getEnchantmentByLocation(java.lang.String location)
Retrieves an enchantment by using its location name.
|
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.
|
int |
getMinLevel()
Returns the minimum level that the enchantment can have.
|
java.lang.String |
getName()
Return the name of key in translation table of this enchantment.
|
java.lang.String |
getTranslatedName(int level)
Returns the correct traslated name of the enchantment and the level in roman numbers.
|
int |
getWeight()
Retrieves the weight value of an Enchantment.
|
boolean |
isAllowedOnBooks()
Is this enchantment allowed to be enchanted on books via Enchantment Table
|
void |
onEntityDamaged(EntityLivingBase user,
Entity target,
int level)
Called whenever a mob is damaged with an item that has this enchantment on it.
|
void |
onUserHurt(EntityLivingBase user,
Entity attacker,
int level)
Whenever an entity that has this enchantment on one of its associated items is damaged this method will be
called.
|
Enchantment |
setName(java.lang.String enchName)
Sets the enchantment name
|
public static final Enchantment[] enchantmentsBookList
public static final Enchantment protection
public static final Enchantment fireProtection
public static final Enchantment featherFalling
public static final Enchantment blastProtection
public static final Enchantment projectileProtection
public static final Enchantment respiration
public static final Enchantment aquaAffinity
public static final Enchantment thorns
public static final Enchantment depthStrider
public static final Enchantment sharpness
public static final Enchantment smite
public static final Enchantment baneOfArthropods
public static final Enchantment knockback
public static final Enchantment fireAspect
public static final Enchantment looting
public static final Enchantment efficiency
public static final Enchantment silkTouch
public static final Enchantment unbreaking
public static final Enchantment fortune
public static final Enchantment power
public static final Enchantment punch
public static final Enchantment flame
public static final Enchantment infinity
public static final Enchantment luckOfTheSea
public static final Enchantment lure
public final int effectId
public EnumEnchantmentType type
protected java.lang.String name
protected Enchantment(int enchID, ResourceLocation enchName, int enchWeight, EnumEnchantmentType enchType)
public static Enchantment getEnchantmentById(int enchID)
public static Enchantment getEnchantmentByLocation(java.lang.String location)
public static java.util.Set<ResourceLocation> func_181077_c()
public int getWeight()
public int getMinLevel()
public int getMaxLevel()
public int getMinEnchantability(int enchantmentLevel)
public int getMaxEnchantability(int enchantmentLevel)
public int calcModifierDamage(int level, DamageSource source)
public float calcDamageByCreature(int level, EnumCreatureAttribute creatureType)
public boolean canApplyTogether(Enchantment ench)
public Enchantment setName(java.lang.String enchName)
public java.lang.String getName()
public java.lang.String getTranslatedName(int level)
public boolean canApply(ItemStack stack)
public void onEntityDamaged(EntityLivingBase user, Entity target, int level)
public void onUserHurt(EntityLivingBase user, Entity attacker, int level)
public boolean canApplyAtEnchantingTable(ItemStack stack)
canApply(ItemStack)
applies for all possible enchantments.stack
- public static void addToBookList(Enchantment enchantment)
enchantment
- public boolean isAllowedOnBooks()