Uses of Record Class
net.minecraft.world.item.enchantment.Enchantment
Package
Description
-
Uses of Enchantment in net.minecraft.advancements.critereon
Modifier and TypeFieldDescriptionprivate final Optional
<HolderSet<Enchantment>> EnchantmentPredicate.enchantments
The field for theenchantments
record component.Modifier and TypeMethodDescriptionEnchantmentPredicate.enchantments()
Returns the value of theenchantments
record component.Modifier and TypeMethodDescriptionprivate boolean
EnchantmentPredicate.matchesEnchantment
(ItemEnchantments p_346384_, Holder<Enchantment> p_345318_) ModifierConstructorDescriptionEnchantmentPredicate
(Optional<HolderSet<Enchantment>> enchantments, MinMaxBounds.Ints level) Creates an instance of aEnchantmentPredicate
record class.EnchantmentPredicate
(Holder<Enchantment> p_345021_, MinMaxBounds.Ints p_345012_) EnchantmentPredicate
(HolderSet<Enchantment> p_346051_, MinMaxBounds.Ints p_30472_) -
Uses of Enchantment in net.minecraft.commands.arguments
Modifier and TypeMethodDescriptionstatic Holder.Reference
<Enchantment> ResourceArgument.getEnchantment
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_248656_, String p_248713_) -
Uses of Enchantment in net.minecraft.core.registries
Modifier and TypeFieldDescriptionstatic final ResourceKey
<Registry<Enchantment>> Registries.ENCHANTMENT
-
Uses of Enchantment in net.minecraft.data.loot.packs
Modifier and TypeMethodDescriptionstatic LootTable.Builder
VanillaEquipmentLoot.trialChamberEquipment
(Item p_345453_, Item p_345712_, ArmorTrim p_346117_, HolderLookup.RegistryLookup<Enchantment> p_345542_) -
Uses of Enchantment in net.minecraft.server.commands
Modifier and TypeMethodDescriptionprivate static int
EnchantCommand.enchant
(CommandSourceStack p_249815_, Collection<? extends Entity> p_248848_, Holder<Enchantment> p_251252_, int p_249941_) -
Uses of Enchantment in net.minecraft.tags
Modifier and TypeFieldDescriptionstatic final TagKey
<Enchantment> EnchantmentTags.ARMOR_EXCLUSIVE
static final TagKey
<Enchantment> EnchantmentTags.BOOTS_EXCLUSIVE
static final TagKey
<Enchantment> EnchantmentTags.BOW_EXCLUSIVE
static final TagKey
<Enchantment> EnchantmentTags.CROSSBOW_EXCLUSIVE
static final TagKey
<Enchantment> EnchantmentTags.CURSE
static final TagKey
<Enchantment> EnchantmentTags.DAMAGE_EXCLUSIVE
static final TagKey
<Enchantment> EnchantmentTags.DOUBLE_TRADE_PRICE
static final TagKey
<Enchantment> EnchantmentTags.IN_ENCHANTING_TABLE
static final TagKey
<Enchantment> EnchantmentTags.MINING_EXCLUSIVE
static final TagKey
<Enchantment> EnchantmentTags.NON_TREASURE
static final TagKey
<Enchantment> EnchantmentTags.ON_MOB_SPAWN_EQUIPMENT
static final TagKey
<Enchantment> EnchantmentTags.ON_RANDOM_LOOT
static final TagKey
<Enchantment> EnchantmentTags.ON_TRADED_EQUIPMENT
static final TagKey
<Enchantment> EnchantmentTags.PREVENTS_BEE_SPAWNS_WHEN_MINING
static final TagKey
<Enchantment> EnchantmentTags.PREVENTS_DECORATED_POT_SHATTERING
static final TagKey
<Enchantment> EnchantmentTags.PREVENTS_ICE_MELTING
static final TagKey
<Enchantment> EnchantmentTags.PREVENTS_INFESTED_SPAWNS
static final TagKey
<Enchantment> EnchantmentTags.RIPTIDE_EXCLUSIVE
static final TagKey
<Enchantment> EnchantmentTags.SMELTS_LOOT
static final TagKey
<Enchantment> EnchantmentTags.TOOLTIP_ORDER
static final TagKey
<Enchantment> EnchantmentTags.TRADEABLE
static final TagKey
<Enchantment> EnchantmentTags.TRADES_DESERT_COMMON
static final TagKey
<Enchantment> EnchantmentTags.TRADES_DESERT_SPECIAL
static final TagKey
<Enchantment> EnchantmentTags.TRADES_JUNGLE_COMMON
static final TagKey
<Enchantment> EnchantmentTags.TRADES_JUNGLE_SPECIAL
static final TagKey
<Enchantment> EnchantmentTags.TRADES_PLAINS_COMMON
static final TagKey
<Enchantment> EnchantmentTags.TRADES_PLAINS_SPECIAL
static final TagKey
<Enchantment> EnchantmentTags.TRADES_SAVANNA_COMMON
static final TagKey
<Enchantment> EnchantmentTags.TRADES_SAVANNA_SPECIAL
static final TagKey
<Enchantment> EnchantmentTags.TRADES_SNOW_COMMON
static final TagKey
<Enchantment> EnchantmentTags.TRADES_SNOW_SPECIAL
static final TagKey
<Enchantment> EnchantmentTags.TRADES_SWAMP_COMMON
static final TagKey
<Enchantment> EnchantmentTags.TRADES_SWAMP_SPECIAL
static final TagKey
<Enchantment> EnchantmentTags.TRADES_TAIGA_COMMON
static final TagKey
<Enchantment> EnchantmentTags.TRADES_TAIGA_SPECIAL
static final TagKey
<Enchantment> EnchantmentTags.TREASURE
-
Uses of Enchantment in net.minecraft.world.entity
Modifier and TypeFieldDescriptionprivate final it.unimi.dsi.fastutil.objects.Reference2ObjectMap
<Enchantment, Set<EnchantmentLocationBasedEffect>> LivingEntity.activeLocationDependentEnchantments
-
Uses of Enchantment in net.minecraft.world.entity.npc
Modifier and TypeFieldDescriptionprivate final TagKey
<Enchantment> VillagerTrades.EnchantBookForEmeralds.tradeableEnchantments
ModifierConstructorDescriptionEnchantBookForEmeralds
(int p_296323_, int p_345122_, int p_346010_, TagKey<Enchantment> p_346031_) EnchantBookForEmeralds
(int p_296300_, TagKey<Enchantment> p_345350_) -
Uses of Enchantment in net.minecraft.world.item
Modifier and TypeMethodDescriptionvoid
ItemStack.enchant
(Holder<Enchantment> p_344751_, int p_41665_) private static void
CreativeModeTabs.generateEnchantmentBookTypesAllLevels
(CreativeModeTab.Output p_270961_, HolderLookup<Enchantment> p_270628_, CreativeModeTab.TabVisibility p_270805_) private static void
CreativeModeTabs.generateEnchantmentBookTypesOnlyMaxLevel
(CreativeModeTab.Output p_270868_, HolderLookup<Enchantment> p_270903_, CreativeModeTab.TabVisibility p_270407_) -
Uses of Enchantment in net.minecraft.world.item.enchantment
Modifier and TypeFieldDescriptionstatic final ResourceKey
<Enchantment> Enchantments.AQUA_AFFINITY
static final ResourceKey
<Enchantment> Enchantments.BANE_OF_ARTHROPODS
static final ResourceKey
<Enchantment> Enchantments.BINDING_CURSE
static final ResourceKey
<Enchantment> Enchantments.BLAST_PROTECTION
static final ResourceKey
<Enchantment> Enchantments.BREACH
static final ResourceKey
<Enchantment> Enchantments.CHANNELING
static final com.mojang.serialization.Codec
<Holder<Enchantment>> Enchantment.CODEC
static final ResourceKey
<Enchantment> Enchantments.DENSITY
static final ResourceKey
<Enchantment> Enchantments.DEPTH_STRIDER
static final com.mojang.serialization.Codec
<Enchantment> Enchantment.DIRECT_CODEC
static final ResourceKey
<Enchantment> Enchantments.EFFICIENCY
final Holder
<Enchantment> EnchantmentInstance.enchantment
(package private) final it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap
<Holder<Enchantment>> ItemEnchantments.enchantments
private final it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap
<Holder<Enchantment>> ItemEnchantments.Mutable.enchantments
private HolderSet
<Enchantment> Enchantment.Builder.exclusiveSet
private final HolderSet
<Enchantment> Enchantment.exclusiveSet
The field for theexclusiveSet
record component.static final ResourceKey
<Enchantment> Enchantments.FEATHER_FALLING
static final ResourceKey
<Enchantment> Enchantments.FIRE_ASPECT
static final ResourceKey
<Enchantment> Enchantments.FIRE_PROTECTION
static final ResourceKey
<Enchantment> Enchantments.FLAME
static final ResourceKey
<Enchantment> Enchantments.FORTUNE
static final ResourceKey
<Enchantment> Enchantments.FROST_WALKER
static final ResourceKey
<Enchantment> Enchantments.IMPALING
static final ResourceKey
<Enchantment> Enchantments.INFINITY
static final ResourceKey
<Enchantment> Enchantments.KNOCKBACK
private static final com.mojang.serialization.Codec
<it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<Holder<Enchantment>>> ItemEnchantments.LEVELS_CODEC
static final ResourceKey
<Enchantment> Enchantments.LOOTING
static final ResourceKey
<Enchantment> Enchantments.LOYALTY
static final ResourceKey
<Enchantment> Enchantments.LUCK_OF_THE_SEA
static final ResourceKey
<Enchantment> Enchantments.LURE
static final ResourceKey
<Enchantment> Enchantments.MENDING
static final ResourceKey
<Enchantment> Enchantments.MULTISHOT
static final ResourceKey
<Enchantment> Enchantments.PIERCING
static final ResourceKey
<Enchantment> Enchantments.POWER
static final ResourceKey
<Enchantment> Enchantments.PROJECTILE_PROTECTION
static final ResourceKey
<Enchantment> Enchantments.PROTECTION
static final ResourceKey
<Enchantment> Enchantments.PUNCH
static final ResourceKey
<Enchantment> Enchantments.QUICK_CHARGE
static final ResourceKey
<Enchantment> Enchantments.RESPIRATION
static final ResourceKey
<Enchantment> Enchantments.RIPTIDE
static final ResourceKey
<Enchantment> Enchantments.SHARPNESS
static final ResourceKey
<Enchantment> Enchantments.SILK_TOUCH
static final ResourceKey
<Enchantment> Enchantments.SMITE
static final ResourceKey
<Enchantment> Enchantments.SOUL_SPEED
static final StreamCodec
<RegistryFriendlyByteBuf, Holder<Enchantment>> Enchantment.STREAM_CODEC
static final ResourceKey
<Enchantment> Enchantments.SWEEPING_EDGE
static final ResourceKey
<Enchantment> Enchantments.SWIFT_SNEAK
static final ResourceKey
<Enchantment> Enchantments.THORNS
static final ResourceKey
<Enchantment> Enchantments.UNBREAKING
static final ResourceKey
<Enchantment> Enchantments.VANISHING_CURSE
static final ResourceKey
<Enchantment> Enchantments.WIND_BURST
Modifier and TypeMethodDescriptionSet
<it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Holder<Enchantment>>> ItemEnchantments.entrySet()
Enchantment.exclusiveSet()
Returns the value of theexclusiveSet
record component.private static ResourceKey
<Enchantment> ItemEnchantments.keySet()
ItemEnchantments.Mutable.keySet()
Modifier and TypeMethodDescriptionvoid
EnchantmentHelper.EnchantmentInSlotVisitor.accept
(Holder<Enchantment> p_346326_, int p_346009_, EnchantedItemInUse p_345960_) void
EnchantmentHelper.EnchantmentVisitor.accept
(Holder<Enchantment> p_346050_, int p_44946_) static boolean
Enchantment.areCompatible
(Holder<Enchantment> p_345800_, Holder<Enchantment> p_346143_) static void
Enchantments.bootstrap
(BootstrapContext<Enchantment> p_345935_) static ItemStack
EnchantmentHelper.enchantItem
(RandomSource p_220293_, ItemStack p_220294_, int p_220295_, Stream<Holder<Enchantment>> p_345380_) static ItemStack
EnchantmentHelper.enchantItem
(RandomSource p_346328_, ItemStack p_346267_, int p_345272_, RegistryAccess p_345660_, Optional<? extends HolderSet<Enchantment>> p_345161_) Enchantment.Builder.exclusiveWith
(HolderSet<Enchantment> p_346264_) static List
<EnchantmentInstance> EnchantmentHelper.getAvailableEnchantmentResults
(int p_44818_, ItemStack p_44819_, Stream<Holder<Enchantment>> p_345348_) static int
EnchantmentHelper.getEnchantmentLevel
(Holder<Enchantment> p_345086_, LivingEntity p_44838_) static Component
Enchantment.getFullname
(Holder<Enchantment> p_345597_, int p_44701_) static int
EnchantmentHelper.getItemEnchantmentLevel
(Holder<Enchantment> p_346179_, ItemStack p_44845_) Deprecated.int
ItemEnchantments.getLevel
(Holder<Enchantment> p_345693_) int
ItemEnchantments.Mutable.getLevel
(Holder<Enchantment> p_345430_) static int
EnchantmentHelper.getTagEnchantmentLevel
(Holder<Enchantment> p_346179_, ItemStack p_44845_) Gets the level of an enchantment from NBT.static boolean
EnchantmentHelper.hasTag
(ItemStack p_345665_, TagKey<Enchantment> p_345928_) static boolean
EnchantmentHelper.isEnchantmentCompatible
(Collection<Holder<Enchantment>> p_44860_, Holder<Enchantment> p_345356_) static boolean
EnchantmentHelper.isEnchantmentCompatible
(Collection<Holder<Enchantment>> p_44860_, Holder<Enchantment> p_345356_) private static void
Enchantments.register
(BootstrapContext<Enchantment> p_346019_, ResourceKey<Enchantment> p_345703_, Enchantment.Builder p_345607_) private static void
Enchantments.register
(BootstrapContext<Enchantment> p_346019_, ResourceKey<Enchantment> p_345703_, Enchantment.Builder p_345607_) void
ItemEnchantments.Mutable.removeIf
(Predicate<Holder<Enchantment>> p_332079_) static List
<EnchantmentInstance> EnchantmentHelper.selectEnchantment
(RandomSource p_220298_, ItemStack p_220299_, int p_220300_, Stream<Holder<Enchantment>> p_346061_) void
ItemEnchantments.Mutable.set
(Holder<Enchantment> p_344861_, int p_330832_) void
ItemEnchantments.Mutable.upgrade
(Holder<Enchantment> p_346263_, int p_331153_) ModifierConstructorDescriptionEnchantment
(Component description, Enchantment.EnchantmentDefinition definition, HolderSet<Enchantment> exclusiveSet, DataComponentMap effects) Creates an instance of aEnchantment
record class.EnchantmentInstance
(Holder<Enchantment> p_345467_, int p_44951_) (package private)
ItemEnchantments
(it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<Holder<Enchantment>> p_341287_, boolean p_330219_) -
Uses of Enchantment in net.minecraft.world.item.enchantment.providers
Modifier and TypeFieldDescriptionprivate final Holder
<Enchantment> SingleEnchantment.enchantment
The field for theenchantment
record component.private final HolderSet
<Enchantment> EnchantmentsByCost.enchantments
The field for theenchantments
record component.private final HolderSet
<Enchantment> EnchantmentsByCostWithDifficulty.enchantments
The field for theenchantments
record component.Modifier and TypeMethodDescriptionSingleEnchantment.enchantment()
Returns the value of theenchantment
record component.EnchantmentsByCost.enchantments()
Returns the value of theenchantments
record component.EnchantmentsByCostWithDifficulty.enchantments()
Returns the value of theenchantments
record component.ModifierConstructorDescriptionEnchantmentsByCost
(HolderSet<Enchantment> enchantments, IntProvider cost) Creates an instance of aEnchantmentsByCost
record class.EnchantmentsByCostWithDifficulty
(HolderSet<Enchantment> enchantments, int minCost, int maxCostSpan) Creates an instance of aEnchantmentsByCostWithDifficulty
record class.SingleEnchantment
(Holder<Enchantment> enchantment, IntProvider level) Creates an instance of aSingleEnchantment
record class. -
Uses of Enchantment in net.minecraft.world.level.storage.loot.functions
Modifier and TypeFieldDescriptionprivate final Holder
<Enchantment> ApplyBonusCount.enchantment
private final Holder
<Enchantment> EnchantedCountIncreaseFunction.Builder.enchantment
private final Holder
<Enchantment> EnchantedCountIncreaseFunction.enchantment
private final com.google.common.collect.ImmutableMap.Builder
<Holder<Enchantment>, NumberProvider> SetEnchantmentsFunction.Builder.enchantments
private final Map
<Holder<Enchantment>, NumberProvider> SetEnchantmentsFunction.enchantments
private Optional
<HolderSet<Enchantment>> EnchantRandomlyFunction.Builder.options
private final Optional
<HolderSet<Enchantment>> EnchantRandomlyFunction.options
private Optional
<HolderSet<Enchantment>> EnchantWithLevelsFunction.Builder.options
private final Optional
<HolderSet<Enchantment>> EnchantWithLevelsFunction.options
Modifier and TypeMethodDescriptionstatic LootItemConditionalFunction.Builder
<?> ApplyBonusCount.addBonusBinomialDistributionCount
(Holder<Enchantment> p_345484_, float p_79919_, int p_79920_) static LootItemConditionalFunction.Builder
<?> ApplyBonusCount.addOreBonusCount
(Holder<Enchantment> p_344867_) static LootItemConditionalFunction.Builder
<?> ApplyBonusCount.addUniformBonusCount
(Holder<Enchantment> p_345095_) static LootItemConditionalFunction.Builder
<?> ApplyBonusCount.addUniformBonusCount
(Holder<Enchantment> p_344758_, int p_79923_) private static ItemStack
EnchantRandomlyFunction.enchantItem
(ItemStack p_230980_, Holder<Enchantment> p_346257_, RandomSource p_230982_) EnchantWithLevelsFunction.Builder.fromOptions
(HolderSet<Enchantment> p_345342_) EnchantRandomlyFunction.Builder.withEnchantment
(Holder<Enchantment> p_346278_) SetEnchantmentsFunction.Builder.withEnchantment
(Holder<Enchantment> p_346114_, NumberProvider p_165376_) EnchantRandomlyFunction.Builder.withOneOf
(HolderSet<Enchantment> p_345384_) ModifierConstructorDescriptionprivate
ApplyBonusCount
(List<LootItemCondition> p_298532_, Holder<Enchantment> p_298797_, ApplyBonusCount.Formula p_79905_) Builder
(Holder<Enchantment> p_345337_, NumberProvider p_345112_) (package private)
EnchantedCountIncreaseFunction
(List<LootItemCondition> p_344944_, Holder<Enchantment> p_345194_, NumberProvider p_344806_, int p_345432_) (package private)
EnchantRandomlyFunction
(List<LootItemCondition> p_299014_, Optional<HolderSet<Enchantment>> p_298965_, boolean p_344945_) (package private)
EnchantWithLevelsFunction
(List<LootItemCondition> p_298580_, NumberProvider p_165194_, Optional<HolderSet<Enchantment>> p_345769_) (package private)
SetEnchantmentsFunction
(List<LootItemCondition> p_299192_, Map<Holder<Enchantment>, NumberProvider> p_165338_, boolean p_165339_) -
Uses of Enchantment in net.minecraft.world.level.storage.loot.predicates
Modifier and TypeFieldDescriptionprivate final Holder
<Enchantment> BonusLevelTableCondition.enchantment
The field for theenchantment
record component.private final Holder
<Enchantment> LootItemRandomChanceWithEnchantedBonusCondition.enchantment
The field for theenchantment
record component.Modifier and TypeMethodDescriptionBonusLevelTableCondition.enchantment()
Returns the value of theenchantment
record component.LootItemRandomChanceWithEnchantedBonusCondition.enchantment()
Returns the value of theenchantment
record component.Modifier and TypeMethodDescriptionstatic LootItemCondition.Builder
BonusLevelTableCondition.bonusLevelFlatChance
(Holder<Enchantment> p_345516_, float... p_81519_) ModifierConstructorDescriptionBonusLevelTableCondition
(Holder<Enchantment> enchantment, List<Float> values) Creates an instance of aBonusLevelTableCondition
record class.LootItemRandomChanceWithEnchantedBonusCondition
(float unenchantedChance, LevelBasedValue enchantedChance, Holder<Enchantment> enchantment) Creates an instance of aLootItemRandomChanceWithEnchantedBonusCondition
record class. -
Uses of Enchantment in net.neoforged.neoforge.common
Modifier and TypeFieldDescriptionstatic final TagKey
<Enchantment> Tags.Enchantments.ENTITY_AUXILIARY_MOVEMENT_ENHANCEMENTS
For enchantments that applies movement-based benefits unrelated to speed for the entity wearing armor enchanted with it.static final TagKey
<Enchantment> Tags.Enchantments.ENTITY_DEFENSE_ENHANCEMENTS
For enchantments that decrease damage taken or otherwise benefit, in regard to damage, the entity wearing armor enchanted with it.static final TagKey
<Enchantment> Tags.Enchantments.ENTITY_SPEED_ENHANCEMENTS
For enchantments that increase movement speed for entity wearing armor enchanted with it.static final TagKey
<Enchantment> Tags.Enchantments.INCREASE_BLOCK_DROPS
A tag containing enchantments that increase the amount or quality of drops from blocks, such asEnchantments.FORTUNE
.static final TagKey
<Enchantment> Tags.Enchantments.INCREASE_ENTITY_DROPS
A tag containing enchantments that increase the amount or quality of drops from entities, such asEnchantments.LOOTING
.static final TagKey
<Enchantment> Tags.Enchantments.WEAPON_DAMAGE_ENHANCEMENTS
For enchantments that increase the damage dealt by an item. -
Uses of Enchantment in net.neoforged.neoforge.common.extensions
Modifier and TypeMethodDescriptiondefault ItemEnchantments
IItemExtension.getAllEnchantments
(ItemStack stack, HolderLookup.RegistryLookup<Enchantment> lookup) Gets a map of all enchantments present on the stack.default ItemEnchantments
IItemStackExtension.getAllEnchantments
(HolderLookup.RegistryLookup<Enchantment> lookup) Gets the gameplay level of all enchantments on this stack.default int
IItemExtension.getEnchantmentLevel
(ItemStack stack, Holder<Enchantment> enchantment) Gets the level of the enchantment currently present on the stack.default int
IItemStackExtension.getEnchantmentLevel
(Holder<Enchantment> enchantment) Gets the gameplay level of the target enchantment on this stack.default boolean
IItemExtension.isPrimaryItemFor
(ItemStack stack, Holder<Enchantment> enchantment) Checks if an item should be treated as a primary item for a given enchantment.default boolean
IItemStackExtension.isPrimaryItemFor
(Holder<Enchantment> enchantment) -
Uses of Enchantment in net.neoforged.neoforge.debug.loot
Modifier and TypeFieldDescriptionprivate static final ResourceKey
<Enchantment> GlobalLootModifiersTest.SMELT
-
Uses of Enchantment in net.neoforged.neoforge.event
Modifier and TypeMethodDescriptionstatic ItemEnchantments
EventHooks.getAllEnchantmentLevels
(ItemEnchantments enchantments, ItemStack stack, HolderLookup.RegistryLookup<Enchantment> lookup) FiresGetEnchantmentLevelEvent
and for all enchantments, returning the (possibly event-modified) enchantment map.static int
EventHooks.getEnchantmentLevelSpecific
(int level, ItemStack stack, Holder<Enchantment> ench) FiresGetEnchantmentLevelEvent
and for a single enchantment, returning the (possibly event-modified) level. -
Uses of Enchantment in net.neoforged.neoforge.event.enchanting
Modifier and TypeFieldDescriptionprotected final HolderLookup.RegistryLookup
<Enchantment> GetEnchantmentLevelEvent.lookup
protected final @Nullable Holder
<Enchantment> GetEnchantmentLevelEvent.targetEnchant
Modifier and TypeMethodDescriptionGetEnchantmentLevelEvent.getHolder
(ResourceKey<Enchantment> key) Attempts to resolve aHolder.Reference
for a target enchantment.GetEnchantmentLevelEvent.getLookup()
Returns the underlying registry lookup, which can be used to access enchantment Holders.@Nullable Holder
<Enchantment> GetEnchantmentLevelEvent.getTargetEnchant()
This method returns the specific enchantment being queried frominvalid reference
IItemStackExtension#getEnchantmentLevel(Enchantment)
Modifier and TypeMethodDescriptionGetEnchantmentLevelEvent.getHolder
(ResourceKey<Enchantment> key) Attempts to resolve aHolder.Reference
for a target enchantment.boolean
GetEnchantmentLevelEvent.isTargetting
(Holder<Enchantment> ench) Helper method aroundGetEnchantmentLevelEvent.getTargetEnchant()
that checks if the target is the specified enchantment, or if the target is null.boolean
GetEnchantmentLevelEvent.isTargetting
(ResourceKey<Enchantment> ench) Helper method aroundGetEnchantmentLevelEvent.getTargetEnchant()
that checks if the target is the specified enchantment, or if the target is null.ModifierConstructorDescriptionGetEnchantmentLevelEvent
(ItemStack stack, ItemEnchantments.Mutable enchantments, @Nullable Holder<Enchantment> targetEnchant, HolderLookup.RegistryLookup<Enchantment> lookup) GetEnchantmentLevelEvent
(ItemStack stack, ItemEnchantments.Mutable enchantments, @Nullable Holder<Enchantment> targetEnchant, HolderLookup.RegistryLookup<Enchantment> lookup)
EnchantmentHelper.getTagEnchantmentLevel(Holder, ItemStack)
for NBT enchantments, orIItemStackExtension.getEnchantmentLevel(Holder)
for gameplay.