Package net.minecraft.enchantment
Class Enchantment
- java.lang.Object
-
- net.zxmushroom63.plugins.BaseData
-
- net.zxmushroom63.plugins.PluginData
-
- net.minecraft.enchantment.Enchantment
-
- All Implemented Interfaces:
org.teavm.jso.JSObject
- Direct Known Subclasses:
EnchantmentArrowDamage
,EnchantmentArrowFire
,EnchantmentArrowInfinite
,EnchantmentArrowKnockback
,EnchantmentDamage
,EnchantmentDigging
,EnchantmentDurability
,EnchantmentFireAspect
,EnchantmentFishingSpeed
,EnchantmentKnockback
,EnchantmentLootBonus
,EnchantmentOxygen
,EnchantmentProtection
,EnchantmentThorns
,EnchantmentUntouching
,EnchantmentWaterWalker
,EnchantmentWaterWorker
public abstract class Enchantment extends PluginData
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.zxmushroom63.plugins.BaseData
BaseData.BooleanCallback, BaseData.BooleanCallbackArr, BaseData.DataBooleanCallback, BaseData.DataBooleanCallbackArr, BaseData.DataDoubleCallback, BaseData.DataDoubleCallbackArr, BaseData.DataFloatCallback, BaseData.DataFloatCallbackArr, BaseData.DataIntCallback, BaseData.DataIntCallbackArr, BaseData.DataObjectCallback, BaseData.DataObjectCallbackArr, BaseData.DataStringCallback, BaseData.DataStringCallbackArr, BaseData.DataVoidCallback, BaseData.DoubleCallback, BaseData.DoubleCallbackArr, BaseData.FloatCallback, BaseData.FloatCallbackArr, BaseData.IntCallback, BaseData.IntCallbackArr, BaseData.ObjectCallback, BaseData.ObjectCallbackArr, BaseData.StringCallback, BaseData.StringCallbackArr, BaseData.VoidCallback
-
-
Field Summary
Fields Modifier and Type Field Description static Enchantment
aquaAffinity
+ Increases underwater mining ratestatic Enchantment
baneOfArthropods
static Enchantment
blastProtection
+ Protection against explosionsstatic Enchantment
depthStrider
int
effectId
static Enchantment
efficiency
+ Faster resource gathering while in usestatic Enchantment[]
enchantmentsBookList
static Enchantment
featherFalling
static Enchantment
fireAspect
+ Lights mobs on firestatic Enchantment
fireProtection
+ Protection against firestatic Enchantment
flame
+ Flame enchantment for bows.static Enchantment
fortune
+ Can multiply the drop rate of items from blocksstatic Enchantment
infinity
+ Infinity enchantment for bows.static Enchantment
knockback
static Enchantment
looting
+ Mobs have a chance to drop more lootstatic Enchantment
luckOfTheSea
static Enchantment
lure
protected java.lang.String
name
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.static Enchantment
smite
static Enchantment
thorns
EnumEnchantmentType
type
static Enchantment
unbreaking
+ Sometimes, the tool's durability will not be spent when the tool is used
-
Constructor Summary
Constructors Modifier Constructor Description protected
Enchantment(int enchID, ResourceLocation enchName, int enchWeight, EnumEnchantmentType enchType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description float
calcDamageByCreature(int var1, EnumCreatureAttribute var2)
+ 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 itemstack)
+ Determines if this enchantment can be applied to a specific ItemStack.boolean
canApplyTogether(Enchantment enchantment)
+ 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 enchantmentsListstatic Enchantment
getEnchantmentByLocation(java.lang.String location)
+ Retrieves an enchantment by using its location name.int
getMaxEnchantability(int i)
+ 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 i)
+ 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.void
loadPluginData(BaseData data)
PluginData
makePluginData()
static PluginData
makePluginDataStatic()
void
onEntityDamaged(EntityLivingBase var1, Entity var2, int var3)
+ 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-
Methods inherited from class net.zxmushroom63.plugins.BaseData
execFuncBaseData, execFuncObject, execFuncString, getBaseData, getBaseDataArr, getBoolean, getBooleanArr, getByte, getByteArr, getChar, getCharArr, getDouble, getDoubleArr, getFloat, getFloatArr, getInt, getIntArr, getObject, getObjectArr, getShort, getShortArr, getString, getStringArr, has, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setCallbackBoolean, setCallbackBooleanArr, setCallbackBooleanArrWithDataArg, setCallbackBooleanWithDataArg, setCallbackDouble, setCallbackDoubleArr, setCallbackDoubleArrWithDataArg, setCallbackDoubleWithDataArg, setCallbackFloat, setCallbackFloatArr, setCallbackFloatArrWithDataArg, setCallbackFloatWithDataArg, setCallbackInt, setCallbackIntArr, setCallbackIntArrWithDataArg, setCallbackIntWithDataArg, setCallbackObject, setCallbackObjectArr, setCallbackObjectArrWithDataArg, setCallbackObjectWithDataArg, setCallbackString, setCallbackStringArr, setCallbackStringArrWithDataArg, setCallbackStringWithDataArg, setCallbackVoid, setCallbackVoidWithDataArg, setNull
-
-
-
-
Field Detail
-
enchantmentsBookList
public static final Enchantment[] enchantmentsBookList
-
protection
public static final Enchantment protection
-
fireProtection
public static final Enchantment fireProtection
+ Protection against fire
-
featherFalling
public static final Enchantment featherFalling
-
blastProtection
public static final Enchantment blastProtection
+ Protection against explosions
-
projectileProtection
public static final Enchantment projectileProtection
-
respiration
public static final Enchantment respiration
-
aquaAffinity
public static final Enchantment aquaAffinity
+ Increases underwater mining rate
-
thorns
public static final Enchantment thorns
-
depthStrider
public static final Enchantment depthStrider
-
sharpness
public static final Enchantment sharpness
-
smite
public static final Enchantment smite
-
baneOfArthropods
public static final Enchantment baneOfArthropods
-
knockback
public static final Enchantment knockback
-
fireAspect
public static final Enchantment fireAspect
+ Lights mobs on fire
-
looting
public static final Enchantment looting
+ Mobs have a chance to drop more loot
-
efficiency
public static final Enchantment efficiency
+ Faster resource gathering while in use
-
silkTouch
public static final Enchantment silkTouch
+ Blocks mined will drop themselves, even if it should drop something else (e.g. stone will drop stone, not cobblestone)
-
unbreaking
public static final Enchantment unbreaking
+ Sometimes, the tool's durability will not be spent when the tool is used
-
fortune
public static final Enchantment fortune
+ Can multiply the drop rate of items from blocks
-
power
public static final Enchantment power
+ Power enchantment for bows, add's extra damage to arrows.
-
punch
public static final Enchantment punch
+ Knockback enchantments for bows, the arrows will knockback the target when hit.
-
flame
public static final Enchantment flame
+ Flame enchantment for bows. Arrows fired by the bow will be on fire. Any target hit will also set on fire.
-
infinity
public static final Enchantment 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.
-
luckOfTheSea
public static final Enchantment luckOfTheSea
-
lure
public static final Enchantment lure
-
effectId
public final int effectId
-
type
public EnumEnchantmentType type
-
name
protected java.lang.String name
-
-
Constructor Detail
-
Enchantment
protected Enchantment(int enchID, ResourceLocation enchName, int enchWeight, EnumEnchantmentType enchType)
-
-
Method Detail
-
getEnchantmentById
public static Enchantment getEnchantmentById(int enchID)
+ Retrieves an Enchantment from the enchantmentsList
-
loadPluginData
public void loadPluginData(BaseData data)
-
makePluginData
public PluginData makePluginData()
-
makePluginDataStatic
public static PluginData makePluginDataStatic()
-
getEnchantmentByLocation
public static Enchantment getEnchantmentByLocation(java.lang.String location)
+ Retrieves an enchantment by using its location name.
-
func_181077_c
public static java.util.Set<ResourceLocation> func_181077_c()
-
getWeight
public int getWeight()
+ Retrieves the weight value of an Enchantment. This weight value is used within vanilla to determine how rare an enchantment is.
-
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 i)
+ Returns the minimal value of enchantability needed on the enchantment level passed.
-
getMaxEnchantability
public int getMaxEnchantability(int i)
+ Returns the maximum value of enchantability nedded on the enchantment level passed.
-
calcModifierDamage
public int calcModifierDamage(int level, DamageSource source)
+ Calculates the damage protection of the enchantment based on level and damage source passed.
-
calcDamageByCreature
public float calcDamageByCreature(int var1, EnumCreatureAttribute var2)
+ Calculates the additional damage that will be dealt by an item with this enchantment. This alternative to calcModifierDamage is sensitive to the targets EnumCreatureAttribute.
-
canApplyTogether
public boolean canApplyTogether(Enchantment enchantment)
+ Determines if the enchantment passed can be applyied together with this enchantment.
-
setName
public Enchantment setName(java.lang.String enchName)
+ Sets the enchantment name
-
getName
public java.lang.String getName()
+ Return the name of key in translation table of this enchantment.
-
getTranslatedName
public java.lang.String getTranslatedName(int level)
+ Returns the correct traslated name of the enchantment and the level in roman numbers.
-
canApply
public boolean canApply(ItemStack itemstack)
+ Determines if this enchantment can be applied to a specific ItemStack.
-
onEntityDamaged
public void onEntityDamaged(EntityLivingBase var1, Entity var2, int var3)
+ Called whenever a mob is damaged with an item that has this enchantment on it.
-
onUserHurt
public 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.
-
-