Package net.minecraft.enchantment
Class Enchantment
- All Implemented Interfaces:
IForgeRegistryEntry<Enchantment>
- Direct Known Subclasses:
AquaAffinityEnchantment,BindingCurseEnchantment,ChannelingEnchantment,DamageEnchantment,DepthStriderEnchantment,EfficiencyEnchantment,FireAspectEnchantment,FlameEnchantment,FrostWalkerEnchantment,GlobalLootModifiersTest.SmelterEnchantment,ImpalingEnchantment,InfinityEnchantment,KnockbackEnchantment,LootBonusEnchantment,LoyaltyEnchantment,LureEnchantment,MendingEnchantment,MultishotEnchantment,PiercingEnchantment,PowerEnchantment,ProtectionEnchantment,PunchEnchantment,QuickChargeEnchantment,RespirationEnchantment,RiptideEnchantment,SilkTouchEnchantment,SoulSpeedEnchantment,SweepingEnchantment,ThornsEnchantment,UnbreakingEnchantment,VanishingCurseEnchantment
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>> -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal EnchantmentTypeprotected Stringprivate final Enchantment.Rarityprivate final ReverseTagWrapper<Enchantment>private final EquipmentSlotType[]Fields inherited from class net.minecraftforge.registries.ForgeRegistryEntry
delegate -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEnchantment(Enchantment.Rarity p_i46731_1_, EnchantmentType p_i46731_2_, EquipmentSlotType[] p_i46731_3_) -
Method Summary
Modifier and TypeMethodDescriptionstatic EnchantmentbyId(int p_185262_0_) booleanThis applies specifically to applying at the enchanting table.booleancanEnchant(ItemStack p_92089_1_) protected booleancheckCompatibility(Enchantment p_77326_1_) voiddoPostAttack(LivingEntity p_151368_1_, Entity p_151368_2_, int p_151368_3_) voiddoPostHurt(LivingEntity p_151367_1_, Entity p_151367_2_, int p_151367_3_) floatgetDamageBonus(int p_152376_1_, CreatureAttribute p_152376_2_) intgetDamageProtection(int p_77318_1_, DamageSource p_77318_2_) getFullname(int p_200305_1_) intgetMaxCost(int p_223551_1_) intintgetMinCost(int p_77321_1_) intprotected StringgetSlotItems(LivingEntity p_222181_1_) getTags()booleanIs this enchantment allowed to be enchanted on books via Enchantment Tablefinal booleanisCompatibleWith(Enchantment p_191560_1_) booleanisCurse()booleanbooleanisIn(ITag<Enchantment> tag) booleanbooleanMethods inherited from class net.minecraftforge.registries.ForgeRegistryEntry
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
-
Field Details
-
reverseTags
-
slots
-
rarity
-
category
-
descriptionId
-
-
Constructor Details
-
Enchantment
protected Enchantment(Enchantment.Rarity p_i46731_1_, EnchantmentType p_i46731_2_, EquipmentSlotType[] p_i46731_3_)
-
-
Method Details
-
byId
-
getTags
-
isIn
-
getSlotItems
-
getRarity
-
getMinLevel
public int getMinLevel() -
getMaxLevel
public int getMaxLevel() -
getMinCost
public int getMinCost(int p_77321_1_) -
getMaxCost
public int getMaxCost(int p_223551_1_) -
getDamageProtection
-
getDamageBonus
-
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 method#canApply(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
-