public abstract class Enchantment extends ForgeRegistryEntry<Enchantment>
Modifier and Type | Class and Description |
---|---|
static class |
Enchantment.Rarity |
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>>
Modifier and Type | Field and Description |
---|---|
EnchantmentType |
category |
protected java.lang.String |
descriptionId |
private Enchantment.Rarity |
rarity |
private ReverseTagWrapper<Enchantment> |
reverseTags |
private EquipmentSlotType[] |
slots |
delegate
Modifier | Constructor and Description |
---|---|
protected |
Enchantment(Enchantment.Rarity p_i46731_1_,
EnchantmentType p_i46731_2_,
EquipmentSlotType[] p_i46731_3_) |
Modifier and Type | Method and 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 Table
|
boolean |
isCompatibleWith(Enchantment p_191560_1_) |
boolean |
isCurse() |
boolean |
isDiscoverable() |
boolean |
isIn(ITag<Enchantment> tag) |
boolean |
isTradeable() |
boolean |
isTreasureOnly() |
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
private final ReverseTagWrapper<Enchantment> reverseTags
private final EquipmentSlotType[] slots
private final Enchantment.Rarity rarity
public final EnchantmentType category
@Nullable protected java.lang.String descriptionId
protected Enchantment(Enchantment.Rarity p_i46731_1_, EnchantmentType p_i46731_2_, EquipmentSlotType[] p_i46731_3_)
@Nullable public static Enchantment byId(int p_185262_0_)
public java.util.Set<ResourceLocation> getTags()
public boolean isIn(ITag<Enchantment> tag)
public java.util.Map<EquipmentSlotType,ItemStack> getSlotItems(LivingEntity p_222181_1_)
public Enchantment.Rarity getRarity()
public int getMinLevel()
public int getMaxLevel()
public int getMinCost(int p_77321_1_)
public int getMaxCost(int p_223551_1_)
public int getDamageProtection(int p_77318_1_, DamageSource p_77318_2_)
public float getDamageBonus(int p_152376_1_, CreatureAttribute p_152376_2_)
public final boolean isCompatibleWith(Enchantment p_191560_1_)
protected boolean checkCompatibility(Enchantment p_77326_1_)
protected java.lang.String getOrCreateDescriptionId()
public java.lang.String getDescriptionId()
public ITextComponent getFullname(int p_200305_1_)
public boolean canEnchant(ItemStack p_92089_1_)
public void doPostAttack(LivingEntity p_151368_1_, Entity p_151368_2_, int p_151368_3_)
public void doPostHurt(LivingEntity p_151367_1_, Entity p_151367_2_, int p_151367_3_)
public boolean isTreasureOnly()
public boolean isCurse()
public boolean isTradeable()
public boolean isDiscoverable()
public boolean canApplyAtEnchantingTable(ItemStack stack)
#canApply(ItemStack)
applies for all possible enchantments.stack
- public boolean isAllowedOnBooks()