Package net.minecraft.enchantment
Class Enchantment
java.lang.Object
net.minecraft.enchantment.Enchantment
- Direct Known Subclasses:
AquaAffinityEnchantment,BindingCurseEnchantment,ChannelingEnchantment,DamageEnchantment,DepthStriderEnchantment,EfficiencyEnchantment,FireAspectEnchantment,FlameEnchantment,FrostWalkerEnchantment,ImpalingEnchantment,InfinityEnchantment,KnockbackEnchantment,LoyaltyEnchantment,LuckEnchantment,LureEnchantment,MendingEnchantment,MultishotEnchantment,PiercingEnchantment,PowerEnchantment,ProtectionEnchantment,PunchEnchantment,QuickChargeEnchantment,RespirationEnchantment,RiptideEnchantment,SilkTouchEnchantment,SoulSpeedEnchantment,SweepingEnchantment,ThornsEnchantment,UnbreakingEnchantment,VanishingCurseEnchantment
public abstract class Enchantment extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEnchantment.RarityThe rarity is an attribute of an enchantment. -
Field Summary
Fields Modifier and Type Field Description private Enchantment.Rarityrarityprivate EquipmentSlot[]slotTypesprotected StringtranslationKeyEnchantmentTargettype -
Constructor Summary
Constructors Modifier Constructor Description protectedEnchantment(Enchantment.Rarity weight, EnchantmentTarget type, EquipmentSlot[] slotTypes) -
Method Summary
Modifier and Type Method Description static EnchantmentbyRawId(int id)protected booleancanAccept(Enchantment other)Returns whether this enchantment can exist on an item stack with theotherenchantment.booleancanCombine(Enchantment other)Returns whether this enchantment can exist on an item stack with theotherenchantment and theotherenchantment can exist with this enchantment.floatgetAttackDamage(int level, EntityGroup group)Map<EquipmentSlot,ItemStack>getEquipment(LivingEntity entity)intgetMaxLevel()intgetMaxPower(int level)intgetMinLevel()intgetMinPower(int level)TextgetName(int level)protected StringgetOrCreateTranslationKey()intgetProtectionAmount(int level, DamageSource source)Enchantment.RaritygetRarity()StringgetTranslationKey()booleanisAcceptableItem(ItemStack stack)booleanisAvailableForEnchantedBookOffer()Returns whether this enchantment will appear in the enchanted book trade offers of librarian villagers.booleanisAvailableForRandomSelection()Returns whether this enchantment will appear in the enchanting table or loots with random enchant function.booleanisCursed()booleanisTreasure()voidonTargetDamaged(LivingEntity user, Entity target, int level)voidonUserDamaged(LivingEntity user, Entity attacker, int level)
-
Field Details
-
slotTypes
-
rarity
-
type
-
translationKey
-
-
Constructor Details
-
Enchantment
protected Enchantment(Enchantment.Rarity weight, EnchantmentTarget type, EquipmentSlot[] slotTypes)
-
-
Method Details
-
byRawId
-
getEquipment
-
getRarity
-
getMinLevel
public int getMinLevel() -
getMaxLevel
public int getMaxLevel() -
getMinPower
public int getMinPower(int level) -
getMaxPower
public int getMaxPower(int level) -
getProtectionAmount
-
getAttackDamage
-
canCombine
Returns whether this enchantment can exist on an item stack with theotherenchantment and theotherenchantment can exist with this enchantment. -
canAccept
Returns whether this enchantment can exist on an item stack with theotherenchantment. -
getOrCreateTranslationKey
-
getTranslationKey
-
getName
-
isAcceptableItem
-
onTargetDamaged
-
onUserDamaged
-
isTreasure
public boolean isTreasure() -
isCursed
public boolean isCursed() -
isAvailableForEnchantedBookOffer
public boolean isAvailableForEnchantedBookOffer()Returns whether this enchantment will appear in the enchanted book trade offers of librarian villagers. -
isAvailableForRandomSelection
public boolean isAvailableForRandomSelection()Returns whether this enchantment will appear in the enchanting table or loots with random enchant function.
-