public abstract class Enchantment extends ForgeRegistryEntry<Enchantment>
Modifier and Type | Class and Description |
---|---|
static class |
Enchantment.Rarity |
Modifier and Type | Field and Description |
---|---|
private EquipmentSlotType[] |
applicableEquipmentTypes |
protected java.lang.String |
name |
private Enchantment.Rarity |
rarity |
EnchantmentType |
type |
delegate
Modifier | Constructor and Description |
---|---|
protected |
Enchantment(Enchantment.Rarity rarityIn,
EnchantmentType typeIn,
EquipmentSlotType[] slots) |
Modifier and Type | Method and Description |
---|---|
float |
calcDamageByCreature(int level,
CreatureAttribute creatureType) |
int |
calcModifierDamage(int level,
DamageSource source) |
boolean |
canApply(ItemStack stack) |
boolean |
canApplyAtEnchantingTable(ItemStack stack)
This applies specifically to applying at the enchanting table.
|
protected boolean |
canApplyTogether(Enchantment ench) |
protected java.lang.String |
getDefaultTranslationKey() |
ITextComponent |
getDisplayName(int level) |
static Enchantment |
getEnchantmentByID(int id) |
java.util.Map<EquipmentSlotType,ItemStack> |
getEntityEquipment(LivingEntity livingEntityIn) |
int |
getMaxEnchantability(int enchantmentLevel) |
int |
getMaxLevel() |
int |
getMinEnchantability(int enchantmentLevel) |
int |
getMinLevel() |
java.lang.String |
getName() |
Enchantment.Rarity |
getRarity() |
boolean |
isAllowedOnBooks()
Is this enchantment allowed to be enchanted on books via Enchantment Table
|
boolean |
isCompatibleWith(Enchantment enchantmentIn) |
boolean |
isCurse() |
boolean |
isTreasureEnchantment() |
void |
onEntityDamaged(LivingEntity user,
Entity target,
int level) |
void |
onUserHurt(LivingEntity user,
Entity attacker,
int level) |
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
private final EquipmentSlotType[] applicableEquipmentTypes
private final Enchantment.Rarity rarity
@Nullable public EnchantmentType type
@Nullable protected java.lang.String name
protected Enchantment(Enchantment.Rarity rarityIn, EnchantmentType typeIn, EquipmentSlotType[] slots)
@Nullable public static Enchantment getEnchantmentByID(int id)
public java.util.Map<EquipmentSlotType,ItemStack> getEntityEquipment(LivingEntity livingEntityIn)
public Enchantment.Rarity getRarity()
public int getMinLevel()
public int getMaxLevel()
public int getMinEnchantability(int enchantmentLevel)
public int getMaxEnchantability(int enchantmentLevel)
public int calcModifierDamage(int level, DamageSource source)
public float calcDamageByCreature(int level, CreatureAttribute creatureType)
public final boolean isCompatibleWith(Enchantment enchantmentIn)
protected boolean canApplyTogether(Enchantment ench)
protected java.lang.String getDefaultTranslationKey()
public java.lang.String getName()
public ITextComponent getDisplayName(int level)
public boolean canApply(ItemStack stack)
public void onEntityDamaged(LivingEntity user, Entity target, int level)
public void onUserHurt(LivingEntity user, Entity attacker, int level)
public boolean isTreasureEnchantment()
public boolean isCurse()
public boolean canApplyAtEnchantingTable(ItemStack stack)
canApply(ItemStack)
applies for all possible enchantments.stack
- public boolean isAllowedOnBooks()