Class Enchantment
java.lang.Object
net.minecraft.world.item.enchantment.Enchantment
- All Implemented Interfaces:
- IEnchantmentExtension
- 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 SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final Holder.Reference<Enchantment>final EnchantmentCategoryprotected Stringprivate final Enchantment.Rarityprivate final EquipmentSlot[]
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedEnchantment(Enchantment.Rarity p_44676_, EnchantmentCategory p_44677_, EquipmentSlot[] p_44678_) 
- 
Method SummaryModifier and TypeMethodDescriptionDeprecated.static 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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.common.extensions.IEnchantmentExtensionallowedInCreativeTab, getDamageBonus
- 
Field Details- 
slots
- 
rarity
- 
category
- 
descriptionId
- 
builtInRegistryHolder
 
- 
- 
Constructor Details- 
Enchantmentprotected Enchantment(Enchantment.Rarity p_44676_, EnchantmentCategory p_44677_, EquipmentSlot[] p_44678_) 
 
- 
- 
Method Details- 
byId
- 
getSlotItems
- 
getRarity
- 
getMinLevelpublic int getMinLevel()
- 
getMaxLevelpublic int getMaxLevel()
- 
getMinCostpublic int getMinCost(int p_44679_) 
- 
getMaxCostpublic int getMaxCost(int p_44691_) 
- 
getDamageProtection
- 
getDamageBonusDeprecated.
- 
isCompatibleWith
- 
checkCompatibility
- 
getOrCreateDescriptionId
- 
getDescriptionId
- 
getFullname
- 
canEnchant
- 
doPostAttack
- 
doPostHurt
- 
isTreasureOnlypublic boolean isTreasureOnly()
- 
isCursepublic boolean isCurse()
- 
isTradeablepublic boolean isTradeable()
- 
isDiscoverablepublic boolean isDiscoverable()
- 
canApplyAtEnchantingTableThis applies specifically to applying at the enchanting table. The other methodcanEnchant(ItemStack)applies for all possible enchantments.- Parameters:
- stack-
- Returns:
 
- 
isAllowedOnBookspublic boolean isAllowedOnBooks()Is this enchantment allowed to be enchanted on books via Enchantment Table- Returns:
- false to disable the vanilla feature
 
- 
builtInRegistryHolderDeprecated.
 
-