Class Enchantment
java.lang.Object
net.minecraft.world.item.enchantment.Enchantment
- All Implemented Interfaces:
IForgeEnchantment
- Direct Known Subclasses:
ArrowDamageEnchantment,ArrowFireEnchantment,ArrowInfiniteEnchantment,ArrowKnockbackEnchantment,ArrowPiercingEnchantment,BindingCurseEnchantment,DamageEnchantment,DigDurabilityEnchantment,DiggingEnchantment,FireAspectEnchantment,FishingSpeedEnchantment,FrostWalkerEnchantment,GlobalLootModifiersTest.SmelterEnchantment,KnockbackEnchantment,LootBonusEnchantment,MendingEnchantment,MultiShotEnchantment,OxygenEnchantment,ProtectionEnchantment,QuickChargeEnchantment,SoulSpeedEnchantment,SweepingEdgeEnchantment,SwiftSneakEnchantment,ThornsEnchantment,TridentChannelingEnchantment,TridentImpalerEnchantment,TridentLoyaltyEnchantment,TridentRiptideEnchantment,UntouchingEnchantment,VanishingCurseEnchantment,WaterWalkerEnchantment,WaterWorkerEnchantment
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal EnchantmentCategoryprotected Stringprivate final Enchantment.Rarityprivate final EquipmentSlot[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEnchantment(Enchantment.Rarity p_44676_, EnchantmentCategory p_44677_, EquipmentSlot[] p_44678_) -
Method Summary
Modifier and TypeMethodDescriptionstatic EnchantmentbyId(int p_44698_) booleanThis applies specifically to applying at the enchanting table.booleancanEnchant(ItemStack p_44689_) protected booleancheckCompatibility(Enchantment p_44690_) voiddoPostAttack(LivingEntity p_44686_, Entity p_44687_, int p_44688_) voiddoPostHurt(LivingEntity p_44692_, Entity p_44693_, int p_44694_) floatgetDamageBonus(int p_44682_, MobType p_44683_) Deprecated.intgetDamageProtection(int p_44680_, DamageSource p_44681_) getFullname(int p_44701_) intgetMaxCost(int p_44691_) intintgetMinCost(int p_44679_) intprotected StringgetSlotItems(LivingEntity p_44685_) booleanIs this enchantment allowed to be enchanted on books via Enchantment Tablefinal booleanisCompatibleWith(Enchantment p_44696_) booleanisCurse()booleanbooleanbooleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraftforge.common.extensions.IForgeEnchantment
allowedInCreativeTab, getDamageBonus
-
Field Details
-
slots
-
rarity
-
category
-
descriptionId
-
-
Constructor Details
-
Enchantment
protected Enchantment(Enchantment.Rarity p_44676_, EnchantmentCategory p_44677_, EquipmentSlot[] p_44678_)
-
-
Method Details
-
byId
-
getSlotItems
-
getRarity
-
getMinLevel
public int getMinLevel() -
getMaxLevel
public int getMaxLevel() -
getMinCost
public int getMinCost(int p_44679_) -
getMaxCost
public int getMaxCost(int p_44691_) -
getDamageProtection
-
getDamageBonus
Deprecated. -
isCompatibleWith
-
checkCompatibility
-
getOrCreateDescriptionId
-
getDescriptionId
-
getFullname
-
canEnchant
-
doPostAttack
-
doPostHurt
-
isTreasureOnly
public boolean isTreasureOnly() -
isCurse
public boolean isCurse() -
isTradeable
public boolean isTradeable() -
isDiscoverable
public boolean isDiscoverable() -
canApplyAtEnchantingTable
This applies specifically to applying at the enchanting table. The other methodcanEnchant(ItemStack)applies for all possible enchantments.- Parameters:
stack-- Returns:
-
isAllowedOnBooks
public boolean isAllowedOnBooks()Is this enchantment allowed to be enchanted on books via Enchantment Table- Returns:
- false to disable the vanilla feature
-