Class Enchantment
java.lang.Object
net.minecraft.world.item.enchantment.Enchantment
- All Implemented Interfaces:
FeatureElement
,IForgeEnchantment
- Direct Known Subclasses:
ArrowInfiniteEnchantment
,ArrowPiercingEnchantment
,BindingCurseEnchantment
,BreachEnchantment
,DamageEnchantment
,DensityEnchantment
,DigDurabilityEnchantment
,FrostWalkerEnchantment
,LootBonusEnchantment
,MendingEnchantment
,MultiShotEnchantment
,ProtectionEnchantment
,SoulSpeedEnchantment
,SwiftSneakEnchantment
,ThornsEnchantment
,TridentRiptideEnchantment
,UntouchingEnchantment
,VanishingCurseEnchantment
,WaterWalkerEnchantment
,WindBurstEnchantment
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
static final record
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Holder.Reference
<Enchantment> private final Enchantment.EnchantmentDefinition
protected String
Fields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.static Enchantment
byId
(int p_44698_) boolean
canEnchant
(ItemStack p_44689_) protected boolean
checkCompatibility
(Enchantment p_44690_) static Enchantment.Cost
constantCost
(int p_334530_) definition
(TagKey<Item> p_334656_, int p_335023_, int p_332990_, Enchantment.Cost p_328936_, Enchantment.Cost p_332239_, int p_332354_, EquipmentSlot... p_334822_) definition
(TagKey<Item> p_335329_, int p_329635_, int p_331888_, Enchantment.Cost p_328182_, Enchantment.Cost p_328787_, int p_333931_, FeatureFlagSet p_330633_, EquipmentSlot... p_330676_) definition
(TagKey<Item> p_329090_, TagKey<Item> p_332240_, int p_328611_, int p_336009_, Enchantment.Cost p_330605_, Enchantment.Cost p_333983_, int p_327771_, EquipmentSlot... p_329538_) void
doPostAttack
(LivingEntity p_44686_, Entity p_44687_, int p_44688_) void
doPostHurt
(LivingEntity p_44692_, Entity p_44693_, int p_44694_) void
doPostItemStackHurt
(LivingEntity p_335453_, Entity p_329978_, int p_331186_) static Enchantment.Cost
dynamicCost
(int p_334326_, int p_335507_) final int
float
getDamageBonus
(int p_44682_, EntityType<?> p_331633_) Deprecated.int
getDamageProtection
(int p_44680_, DamageSource p_44681_) getFullname
(int p_44701_) final int
getMaxCost
(int p_44691_) final int
final int
getMinCost
(int p_44679_) final int
protected String
getSlotItems
(LivingEntity p_44685_) final int
final boolean
isCompatibleWith
(Enchantment p_44696_) boolean
isCurse()
boolean
final boolean
isPrimaryItem
(ItemStack p_334183_) 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.minecraft.world.flag.FeatureElement
isEnabled
Methods inherited from interface net.minecraftforge.common.extensions.IForgeEnchantment
canApplyAtEnchantingTable, getDamageBonus, isAllowedOnBooks
-
Field Details
-
definition
-
descriptionId
-
builtInRegistryHolder
-
-
Constructor Details
-
Enchantment
-
-
Method Details
-
constantCost
-
dynamicCost
-
definition
public static Enchantment.EnchantmentDefinition definition(TagKey<Item> p_329090_, TagKey<Item> p_332240_, int p_328611_, int p_336009_, Enchantment.Cost p_330605_, Enchantment.Cost p_333983_, int p_327771_, EquipmentSlot... p_329538_) -
definition
public static Enchantment.EnchantmentDefinition definition(TagKey<Item> p_334656_, int p_335023_, int p_332990_, Enchantment.Cost p_328936_, Enchantment.Cost p_332239_, int p_332354_, EquipmentSlot... p_334822_) -
definition
public static Enchantment.EnchantmentDefinition definition(TagKey<Item> p_335329_, int p_329635_, int p_331888_, Enchantment.Cost p_328182_, Enchantment.Cost p_328787_, int p_333931_, FeatureFlagSet p_330633_, EquipmentSlot... p_330676_) -
byId
-
getSlotItems
-
getSupportedItems
-
isPrimaryItem
-
getWeight
public final int getWeight() -
getAnvilCost
public final int getAnvilCost() -
getMinLevel
public final int getMinLevel() -
getMaxLevel
public final int getMaxLevel() -
getMinCost
public final int getMinCost(int p_44679_) -
getMaxCost
public final int getMaxCost(int p_44691_) -
getDamageProtection
-
getDamageBonus
Deprecated. -
isCompatibleWith
-
checkCompatibility
-
getOrCreateDescriptionId
-
getDescriptionId
-
getFullname
-
canEnchant
-
doPostAttack
-
doPostHurt
-
doPostItemStackHurt
-
isTreasureOnly
public boolean isTreasureOnly() -
isCurse
public boolean isCurse() -
isTradeable
public boolean isTradeable() -
isDiscoverable
public boolean isDiscoverable() -
builtInRegistryHolder
Deprecated. -
requiredFeatures
- Specified by:
requiredFeatures
in interfaceFeatureElement
-