Package net.minecraft.enchantment
Class Enchantment
- java.lang.Object
-
- net.minecraftforge.registries.ForgeRegistryEntry<Enchantment>
-
- net.minecraft.enchantment.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
public abstract class Enchantment extends ForgeRegistryEntry<Enchantment>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Enchantment.Rarity
-
Nested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>>
-
-
Field Summary
Fields Modifier and Type Field Description EnchantmentType
category
protected java.lang.String
descriptionId
private Enchantment.Rarity
rarity
private ReverseTagWrapper<Enchantment>
reverseTags
private EquipmentSlotType[]
slots
-
Fields inherited from class net.minecraftforge.registries.ForgeRegistryEntry
delegate
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Enchantment(Enchantment.Rarity p_i46731_1_, EnchantmentType p_i46731_2_, EquipmentSlotType[] p_i46731_3_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Enchantment
byId(int p_185262_0_)
boolean
canApplyAtEnchantingTable(ItemStack stack)
This applies specifically to applying at the enchanting table.boolean
canEnchant(ItemStack p_92089_1_)
protected boolean
checkCompatibility(Enchantment p_77326_1_)
void
doPostAttack(LivingEntity p_151368_1_, Entity p_151368_2_, int p_151368_3_)
void
doPostHurt(LivingEntity p_151367_1_, Entity p_151367_2_, int p_151367_3_)
float
getDamageBonus(int p_152376_1_, CreatureAttribute p_152376_2_)
int
getDamageProtection(int p_77318_1_, DamageSource p_77318_2_)
java.lang.String
getDescriptionId()
ITextComponent
getFullname(int p_200305_1_)
int
getMaxCost(int p_223551_1_)
int
getMaxLevel()
int
getMinCost(int p_77321_1_)
int
getMinLevel()
protected java.lang.String
getOrCreateDescriptionId()
Enchantment.Rarity
getRarity()
java.util.Map<EquipmentSlotType,ItemStack>
getSlotItems(LivingEntity p_222181_1_)
java.util.Set<ResourceLocation>
getTags()
boolean
isAllowedOnBooks()
Is this enchantment allowed to be enchanted on books via Enchantment Tableboolean
isCompatibleWith(Enchantment p_191560_1_)
boolean
isCurse()
boolean
isDiscoverable()
boolean
isIn(ITag<Enchantment> tag)
boolean
isTradeable()
boolean
isTreasureOnly()
-
Methods inherited from class net.minecraftforge.registries.ForgeRegistryEntry
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
-
-
-
-
Field Detail
-
reverseTags
private final ReverseTagWrapper<Enchantment> reverseTags
-
slots
private final EquipmentSlotType[] slots
-
rarity
private final Enchantment.Rarity rarity
-
category
public final EnchantmentType category
-
descriptionId
@Nullable protected java.lang.String descriptionId
-
-
Constructor Detail
-
Enchantment
protected Enchantment(Enchantment.Rarity p_i46731_1_, EnchantmentType p_i46731_2_, EquipmentSlotType[] p_i46731_3_)
-
-
Method Detail
-
byId
@Nullable public static Enchantment byId(int p_185262_0_)
-
getTags
public java.util.Set<ResourceLocation> getTags()
-
isIn
public boolean isIn(ITag<Enchantment> tag)
-
getSlotItems
public java.util.Map<EquipmentSlotType,ItemStack> getSlotItems(LivingEntity p_222181_1_)
-
getRarity
public Enchantment.Rarity 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
public int getDamageProtection(int p_77318_1_, DamageSource p_77318_2_)
-
getDamageBonus
public float getDamageBonus(int p_152376_1_, CreatureAttribute p_152376_2_)
-
isCompatibleWith
public final boolean isCompatibleWith(Enchantment p_191560_1_)
-
checkCompatibility
protected boolean checkCompatibility(Enchantment p_77326_1_)
-
getOrCreateDescriptionId
protected java.lang.String getOrCreateDescriptionId()
-
getDescriptionId
public java.lang.String getDescriptionId()
-
getFullname
public ITextComponent getFullname(int p_200305_1_)
-
canEnchant
public boolean canEnchant(ItemStack p_92089_1_)
-
doPostAttack
public void doPostAttack(LivingEntity p_151368_1_, Entity p_151368_2_, int p_151368_3_)
-
doPostHurt
public void doPostHurt(LivingEntity p_151367_1_, Entity p_151367_2_, int p_151367_3_)
-
isTreasureOnly
public boolean isTreasureOnly()
-
isCurse
public boolean isCurse()
-
isTradeable
public boolean isTradeable()
-
isDiscoverable
public boolean isDiscoverable()
-
canApplyAtEnchantingTable
public boolean canApplyAtEnchantingTable(ItemStack stack)
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
-
-