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
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Holder.Reference<Enchantment>
final EnchantmentCategory
protected String
private final Enchantment.Rarity
private final EquipmentSlot[]
-
Constructor Summary
ModifierConstructorDescriptionprotected
Enchantment
(Enchantment.Rarity p_44676_, EnchantmentCategory p_44677_, EquipmentSlot[] p_44678_) -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.static Enchantment
byId
(int p_44698_) boolean
This applies specifically to applying at the enchanting table.boolean
canEnchant
(ItemStack p_44689_) protected boolean
checkCompatibility
(Enchantment p_44690_) void
doPostAttack
(LivingEntity p_44686_, Entity p_44687_, int p_44688_) void
doPostHurt
(LivingEntity p_44692_, Entity p_44693_, int p_44694_) float
getDamageBonus
(int p_44682_, MobType p_44683_) Deprecated.int
getDamageProtection
(int p_44680_, DamageSource p_44681_) getFullname
(int p_44701_) int
getMaxCost
(int p_44691_) int
int
getMinCost
(int p_44679_) int
protected String
getSlotItems
(LivingEntity p_44685_) boolean
Is this enchantment allowed to be enchanted on books via Enchantment Tablefinal boolean
isCompatibleWith
(Enchantment p_44696_) boolean
isCurse()
boolean
boolean
boolean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraftforge.common.extensions.IForgeEnchantment
allowedInCreativeTab, getDamageBonus
-
Field Details
-
slots
-
rarity
-
category
-
descriptionId
-
builtInRegistryHolder
-
-
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
-
builtInRegistryHolder
Deprecated.
-