Uses of Record Class
net.minecraft.world.item.enchantment.Enchantment
Packages that use Enchantment
Package
Description
-
Uses of Enchantment in net.minecraft.advancements.critereon
Fields in net.minecraft.advancements.critereon with type parameters of type EnchantmentModifier and TypeFieldDescriptionprivate final Optional<HolderSet<Enchantment>> EnchantmentPredicate.enchantmentsThe field for theenchantmentsrecord component.Methods in net.minecraft.advancements.critereon that return types with arguments of type EnchantmentModifier and TypeMethodDescriptionEnchantmentPredicate.enchantments()Returns the value of theenchantmentsrecord component.Method parameters in net.minecraft.advancements.critereon with type arguments of type EnchantmentModifier and TypeMethodDescriptionprivate booleanEnchantmentPredicate.matchesEnchantment(ItemEnchantments p_346384_, Holder<Enchantment> p_345318_) Constructor parameters in net.minecraft.advancements.critereon with type arguments of type EnchantmentModifierConstructorDescriptionEnchantmentPredicate(Optional<HolderSet<Enchantment>> enchantments, MinMaxBounds.Ints level) Creates an instance of aEnchantmentPredicaterecord 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
Methods in net.minecraft.commands.arguments that return types with arguments of type EnchantmentModifier 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
Fields in net.minecraft.core.registries with type parameters of type EnchantmentModifier and TypeFieldDescriptionstatic final ResourceKey<Registry<Enchantment>> Registries.ENCHANTMENT -
Uses of Enchantment in net.minecraft.data.loot.packs
Method parameters in net.minecraft.data.loot.packs with type arguments of type EnchantmentModifier and TypeMethodDescriptionstatic LootTable.BuilderVanillaEquipmentLoot.trialChamberEquipment(Item p_345453_, Item p_345712_, ArmorTrim p_346117_, HolderLookup.RegistryLookup<Enchantment> p_345542_) -
Uses of Enchantment in net.minecraft.server.commands
Method parameters in net.minecraft.server.commands with type arguments of type EnchantmentModifier and TypeMethodDescriptionprivate static intEnchantCommand.enchant(CommandSourceStack p_249815_, Collection<? extends Entity> p_248848_, Holder<Enchantment> p_251252_, int p_249941_) -
Uses of Enchantment in net.minecraft.tags
Fields in net.minecraft.tags with type parameters of type EnchantmentModifier and TypeFieldDescriptionstatic final TagKey<Enchantment> EnchantmentTags.ARMOR_EXCLUSIVEstatic final TagKey<Enchantment> EnchantmentTags.BOOTS_EXCLUSIVEstatic final TagKey<Enchantment> EnchantmentTags.BOW_EXCLUSIVEstatic final TagKey<Enchantment> EnchantmentTags.CROSSBOW_EXCLUSIVEstatic final TagKey<Enchantment> EnchantmentTags.CURSEstatic final TagKey<Enchantment> EnchantmentTags.DAMAGE_EXCLUSIVEstatic final TagKey<Enchantment> EnchantmentTags.DOUBLE_TRADE_PRICEstatic final TagKey<Enchantment> EnchantmentTags.IN_ENCHANTING_TABLEstatic final TagKey<Enchantment> EnchantmentTags.MINING_EXCLUSIVEstatic final TagKey<Enchantment> EnchantmentTags.NON_TREASUREstatic final TagKey<Enchantment> EnchantmentTags.ON_MOB_SPAWN_EQUIPMENTstatic final TagKey<Enchantment> EnchantmentTags.ON_RANDOM_LOOTstatic final TagKey<Enchantment> EnchantmentTags.ON_TRADED_EQUIPMENTstatic final TagKey<Enchantment> EnchantmentTags.PREVENTS_BEE_SPAWNS_WHEN_MININGstatic final TagKey<Enchantment> EnchantmentTags.PREVENTS_DECORATED_POT_SHATTERINGstatic final TagKey<Enchantment> EnchantmentTags.PREVENTS_ICE_MELTINGstatic final TagKey<Enchantment> EnchantmentTags.PREVENTS_INFESTED_SPAWNSstatic final TagKey<Enchantment> EnchantmentTags.RIPTIDE_EXCLUSIVEstatic final TagKey<Enchantment> EnchantmentTags.SMELTS_LOOTstatic final TagKey<Enchantment> EnchantmentTags.TOOLTIP_ORDERstatic final TagKey<Enchantment> EnchantmentTags.TRADEABLEstatic final TagKey<Enchantment> EnchantmentTags.TRADES_DESERT_COMMONstatic final TagKey<Enchantment> EnchantmentTags.TRADES_DESERT_SPECIALstatic final TagKey<Enchantment> EnchantmentTags.TRADES_JUNGLE_COMMONstatic final TagKey<Enchantment> EnchantmentTags.TRADES_JUNGLE_SPECIALstatic final TagKey<Enchantment> EnchantmentTags.TRADES_PLAINS_COMMONstatic final TagKey<Enchantment> EnchantmentTags.TRADES_PLAINS_SPECIALstatic final TagKey<Enchantment> EnchantmentTags.TRADES_SAVANNA_COMMONstatic final TagKey<Enchantment> EnchantmentTags.TRADES_SAVANNA_SPECIALstatic final TagKey<Enchantment> EnchantmentTags.TRADES_SNOW_COMMONstatic final TagKey<Enchantment> EnchantmentTags.TRADES_SNOW_SPECIALstatic final TagKey<Enchantment> EnchantmentTags.TRADES_SWAMP_COMMONstatic final TagKey<Enchantment> EnchantmentTags.TRADES_SWAMP_SPECIALstatic final TagKey<Enchantment> EnchantmentTags.TRADES_TAIGA_COMMONstatic final TagKey<Enchantment> EnchantmentTags.TRADES_TAIGA_SPECIALstatic final TagKey<Enchantment> EnchantmentTags.TREASUREMethods in net.minecraft.tags that return types with arguments of type Enchantment -
Uses of Enchantment in net.minecraft.world.entity
Fields in net.minecraft.world.entity with type parameters of type EnchantmentModifier and TypeFieldDescriptionprivate final it.unimi.dsi.fastutil.objects.Reference2ObjectMap<Enchantment, Set<EnchantmentLocationBasedEffect>> LivingEntity.activeLocationDependentEnchantmentsMethods in net.minecraft.world.entity that return types with arguments of type Enchantment -
Uses of Enchantment in net.minecraft.world.entity.npc
Fields in net.minecraft.world.entity.npc with type parameters of type EnchantmentModifier and TypeFieldDescriptionprivate final TagKey<Enchantment> VillagerTrades.EnchantBookForEmeralds.tradeableEnchantmentsConstructor parameters in net.minecraft.world.entity.npc with type arguments of type EnchantmentModifierConstructorDescriptionEnchantBookForEmeralds(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
Method parameters in net.minecraft.world.item with type arguments of type EnchantmentModifier and TypeMethodDescriptionvoidItemStack.enchant(Holder<Enchantment> p_344751_, int p_41665_) private static voidCreativeModeTabs.generateEnchantmentBookTypesAllLevels(CreativeModeTab.Output p_270961_, HolderLookup<Enchantment> p_270628_, CreativeModeTab.TabVisibility p_270805_) private static voidCreativeModeTabs.generateEnchantmentBookTypesOnlyMaxLevel(CreativeModeTab.Output p_270868_, HolderLookup<Enchantment> p_270903_, CreativeModeTab.TabVisibility p_270407_) -
Uses of Enchantment in net.minecraft.world.item.enchantment
Fields in net.minecraft.world.item.enchantment with type parameters of type EnchantmentModifier and TypeFieldDescriptionstatic final ResourceKey<Enchantment> Enchantments.AQUA_AFFINITYstatic final ResourceKey<Enchantment> Enchantments.BANE_OF_ARTHROPODSstatic final ResourceKey<Enchantment> Enchantments.BINDING_CURSEstatic final ResourceKey<Enchantment> Enchantments.BLAST_PROTECTIONstatic final ResourceKey<Enchantment> Enchantments.BREACHstatic final ResourceKey<Enchantment> Enchantments.CHANNELINGstatic final com.mojang.serialization.Codec<Holder<Enchantment>> Enchantment.CODECstatic final ResourceKey<Enchantment> Enchantments.DENSITYstatic final ResourceKey<Enchantment> Enchantments.DEPTH_STRIDERstatic final com.mojang.serialization.Codec<Enchantment> Enchantment.DIRECT_CODECstatic final ResourceKey<Enchantment> Enchantments.EFFICIENCYfinal Holder<Enchantment> EnchantmentInstance.enchantment(package private) final it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<Holder<Enchantment>> ItemEnchantments.enchantmentsprivate final it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<Holder<Enchantment>> ItemEnchantments.Mutable.enchantmentsprivate HolderSet<Enchantment> Enchantment.Builder.exclusiveSetprivate final HolderSet<Enchantment> Enchantment.exclusiveSetThe field for theexclusiveSetrecord component.static final ResourceKey<Enchantment> Enchantments.FEATHER_FALLINGstatic final ResourceKey<Enchantment> Enchantments.FIRE_ASPECTstatic final ResourceKey<Enchantment> Enchantments.FIRE_PROTECTIONstatic final ResourceKey<Enchantment> Enchantments.FLAMEstatic final ResourceKey<Enchantment> Enchantments.FORTUNEstatic final ResourceKey<Enchantment> Enchantments.FROST_WALKERstatic final ResourceKey<Enchantment> Enchantments.IMPALINGstatic final ResourceKey<Enchantment> Enchantments.INFINITYstatic final ResourceKey<Enchantment> Enchantments.KNOCKBACKprivate static final com.mojang.serialization.Codec<it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<Holder<Enchantment>>> ItemEnchantments.LEVELS_CODECstatic final ResourceKey<Enchantment> Enchantments.LOOTINGstatic final ResourceKey<Enchantment> Enchantments.LOYALTYstatic final ResourceKey<Enchantment> Enchantments.LUCK_OF_THE_SEAstatic final ResourceKey<Enchantment> Enchantments.LUREstatic final ResourceKey<Enchantment> Enchantments.MENDINGstatic final ResourceKey<Enchantment> Enchantments.MULTISHOTstatic final ResourceKey<Enchantment> Enchantments.PIERCINGstatic final ResourceKey<Enchantment> Enchantments.POWERstatic final ResourceKey<Enchantment> Enchantments.PROJECTILE_PROTECTIONstatic final ResourceKey<Enchantment> Enchantments.PROTECTIONstatic final ResourceKey<Enchantment> Enchantments.PUNCHstatic final ResourceKey<Enchantment> Enchantments.QUICK_CHARGEstatic final ResourceKey<Enchantment> Enchantments.RESPIRATIONstatic final ResourceKey<Enchantment> Enchantments.RIPTIDEstatic final ResourceKey<Enchantment> Enchantments.SHARPNESSstatic final ResourceKey<Enchantment> Enchantments.SILK_TOUCHstatic final ResourceKey<Enchantment> Enchantments.SMITEstatic final ResourceKey<Enchantment> Enchantments.SOUL_SPEEDstatic final StreamCodec<RegistryFriendlyByteBuf, Holder<Enchantment>> Enchantment.STREAM_CODECstatic final ResourceKey<Enchantment> Enchantments.SWEEPING_EDGEstatic final ResourceKey<Enchantment> Enchantments.SWIFT_SNEAKstatic final ResourceKey<Enchantment> Enchantments.THORNSstatic final ResourceKey<Enchantment> Enchantments.UNBREAKINGstatic final ResourceKey<Enchantment> Enchantments.VANISHING_CURSEstatic final ResourceKey<Enchantment> Enchantments.WIND_BURSTMethods in net.minecraft.world.item.enchantment that return EnchantmentMethods in net.minecraft.world.item.enchantment that return types with arguments of type EnchantmentModifier and TypeMethodDescriptionSet<it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Holder<Enchantment>>> ItemEnchantments.entrySet()Enchantment.exclusiveSet()Returns the value of theexclusiveSetrecord component.private static ResourceKey<Enchantment> ItemEnchantments.keySet()ItemEnchantments.Mutable.keySet()Method parameters in net.minecraft.world.item.enchantment with type arguments of type EnchantmentModifier and TypeMethodDescriptionvoidEnchantmentHelper.EnchantmentInSlotVisitor.accept(Holder<Enchantment> p_346326_, int p_346009_, EnchantedItemInUse p_345960_) voidEnchantmentHelper.EnchantmentVisitor.accept(Holder<Enchantment> p_346050_, int p_44946_) static booleanEnchantment.areCompatible(Holder<Enchantment> p_345800_, Holder<Enchantment> p_346143_) static voidEnchantments.bootstrap(BootstrapContext<Enchantment> p_345935_) static ItemStackEnchantmentHelper.enchantItem(RandomSource p_220293_, ItemStack p_220294_, int p_220295_, Stream<Holder<Enchantment>> p_345380_) static ItemStackEnchantmentHelper.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 intEnchantmentHelper.getEnchantmentLevel(Holder<Enchantment> p_345086_, LivingEntity p_44838_) static ComponentEnchantment.getFullname(Holder<Enchantment> p_345597_, int p_44701_) static intEnchantmentHelper.getItemEnchantmentLevel(Holder<Enchantment> p_346179_, ItemStack p_44845_) Deprecated.intItemEnchantments.getLevel(Holder<Enchantment> p_345693_) intItemEnchantments.Mutable.getLevel(Holder<Enchantment> p_345430_) static intEnchantmentHelper.getTagEnchantmentLevel(Holder<Enchantment> p_346179_, ItemStack p_44845_) Gets the level of an enchantment from NBT.static booleanEnchantmentHelper.hasTag(ItemStack p_345665_, TagKey<Enchantment> p_345928_) static booleanEnchantmentHelper.isEnchantmentCompatible(Collection<Holder<Enchantment>> p_44860_, Holder<Enchantment> p_345356_) static booleanEnchantmentHelper.isEnchantmentCompatible(Collection<Holder<Enchantment>> p_44860_, Holder<Enchantment> p_345356_) private static voidEnchantments.register(BootstrapContext<Enchantment> p_346019_, ResourceKey<Enchantment> p_345703_, Enchantment.Builder p_345607_) private static voidEnchantments.register(BootstrapContext<Enchantment> p_346019_, ResourceKey<Enchantment> p_345703_, Enchantment.Builder p_345607_) voidItemEnchantments.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_) voidItemEnchantments.Mutable.set(Holder<Enchantment> p_344861_, int p_330832_) voidItemEnchantments.Mutable.upgrade(Holder<Enchantment> p_346263_, int p_331153_) Constructor parameters in net.minecraft.world.item.enchantment with type arguments of type EnchantmentModifierConstructorDescriptionEnchantment(Component description, Enchantment.EnchantmentDefinition definition, HolderSet<Enchantment> exclusiveSet, DataComponentMap effects) Creates an instance of aEnchantmentrecord 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
Fields in net.minecraft.world.item.enchantment.providers with type parameters of type EnchantmentModifier and TypeFieldDescriptionprivate final Holder<Enchantment> SingleEnchantment.enchantmentThe field for theenchantmentrecord component.private final HolderSet<Enchantment> EnchantmentsByCost.enchantmentsThe field for theenchantmentsrecord component.private final HolderSet<Enchantment> EnchantmentsByCostWithDifficulty.enchantmentsThe field for theenchantmentsrecord component.Methods in net.minecraft.world.item.enchantment.providers that return types with arguments of type EnchantmentModifier and TypeMethodDescriptionSingleEnchantment.enchantment()Returns the value of theenchantmentrecord component.EnchantmentsByCost.enchantments()Returns the value of theenchantmentsrecord component.EnchantmentsByCostWithDifficulty.enchantments()Returns the value of theenchantmentsrecord component.Constructor parameters in net.minecraft.world.item.enchantment.providers with type arguments of type EnchantmentModifierConstructorDescriptionEnchantmentsByCost(HolderSet<Enchantment> enchantments, IntProvider cost) Creates an instance of aEnchantmentsByCostrecord class.EnchantmentsByCostWithDifficulty(HolderSet<Enchantment> enchantments, int minCost, int maxCostSpan) Creates an instance of aEnchantmentsByCostWithDifficultyrecord class.SingleEnchantment(Holder<Enchantment> enchantment, IntProvider level) Creates an instance of aSingleEnchantmentrecord class. -
Uses of Enchantment in net.minecraft.world.level.storage.loot.functions
Fields in net.minecraft.world.level.storage.loot.functions with type parameters of type EnchantmentModifier and TypeFieldDescriptionprivate final Holder<Enchantment> ApplyBonusCount.enchantmentprivate final Holder<Enchantment> EnchantedCountIncreaseFunction.Builder.enchantmentprivate final Holder<Enchantment> EnchantedCountIncreaseFunction.enchantmentprivate final com.google.common.collect.ImmutableMap.Builder<Holder<Enchantment>, NumberProvider> SetEnchantmentsFunction.Builder.enchantmentsprivate final Map<Holder<Enchantment>, NumberProvider> SetEnchantmentsFunction.enchantmentsprivate Optional<HolderSet<Enchantment>> EnchantRandomlyFunction.Builder.optionsprivate final Optional<HolderSet<Enchantment>> EnchantRandomlyFunction.optionsprivate Optional<HolderSet<Enchantment>> EnchantWithLevelsFunction.Builder.optionsprivate final Optional<HolderSet<Enchantment>> EnchantWithLevelsFunction.optionsMethod parameters in net.minecraft.world.level.storage.loot.functions with type arguments of type EnchantmentModifier 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 ItemStackEnchantRandomlyFunction.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_) Constructor parameters in net.minecraft.world.level.storage.loot.functions with type arguments of type EnchantmentModifierConstructorDescriptionprivateApplyBonusCount(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
Fields in net.minecraft.world.level.storage.loot.predicates with type parameters of type EnchantmentModifier and TypeFieldDescriptionprivate final Holder<Enchantment> BonusLevelTableCondition.enchantmentThe field for theenchantmentrecord component.private final Holder<Enchantment> LootItemRandomChanceWithEnchantedBonusCondition.enchantmentThe field for theenchantmentrecord component.Methods in net.minecraft.world.level.storage.loot.predicates that return types with arguments of type EnchantmentModifier and TypeMethodDescriptionBonusLevelTableCondition.enchantment()Returns the value of theenchantmentrecord component.LootItemRandomChanceWithEnchantedBonusCondition.enchantment()Returns the value of theenchantmentrecord component.Method parameters in net.minecraft.world.level.storage.loot.predicates with type arguments of type EnchantmentModifier and TypeMethodDescriptionstatic LootItemCondition.BuilderBonusLevelTableCondition.bonusLevelFlatChance(Holder<Enchantment> p_345516_, float... p_81519_) Constructor parameters in net.minecraft.world.level.storage.loot.predicates with type arguments of type EnchantmentModifierConstructorDescriptionBonusLevelTableCondition(Holder<Enchantment> enchantment, List<Float> values) Creates an instance of aBonusLevelTableConditionrecord class.LootItemRandomChanceWithEnchantedBonusCondition(float unenchantedChance, LevelBasedValue enchantedChance, Holder<Enchantment> enchantment) Creates an instance of aLootItemRandomChanceWithEnchantedBonusConditionrecord class. -
Uses of Enchantment in net.neoforged.neoforge.common
Fields in net.neoforged.neoforge.common with type parameters of type EnchantmentModifier and TypeFieldDescriptionstatic final TagKey<Enchantment> Tags.Enchantments.ENTITY_AUXILIARY_MOVEMENT_ENHANCEMENTSFor 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_ENHANCEMENTSFor 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_ENHANCEMENTSFor enchantments that increase movement speed for entity wearing armor enchanted with it.static final TagKey<Enchantment> Tags.Enchantments.INCREASE_BLOCK_DROPSA tag containing enchantments that increase the amount or quality of drops from blocks, such asEnchantments.FORTUNE.static final TagKey<Enchantment> Tags.Enchantments.INCREASE_ENTITY_DROPSA tag containing enchantments that increase the amount or quality of drops from entities, such asEnchantments.LOOTING.static final TagKey<Enchantment> Tags.Enchantments.WEAPON_DAMAGE_ENHANCEMENTSFor enchantments that increase the damage dealt by an item.Methods in net.neoforged.neoforge.common that return types with arguments of type Enchantment -
Uses of Enchantment in net.neoforged.neoforge.common.extensions
Method parameters in net.neoforged.neoforge.common.extensions with type arguments of type EnchantmentModifier and TypeMethodDescriptiondefault ItemEnchantmentsIItemExtension.getAllEnchantments(ItemStack stack, HolderLookup.RegistryLookup<Enchantment> lookup) Gets a map of all enchantments present on the stack.default ItemEnchantmentsIItemStackExtension.getAllEnchantments(HolderLookup.RegistryLookup<Enchantment> lookup) Gets the gameplay level of all enchantments on this stack.default intIItemExtension.getEnchantmentLevel(ItemStack stack, Holder<Enchantment> enchantment) Gets the level of the enchantment currently present on the stack.default intIItemStackExtension.getEnchantmentLevel(Holder<Enchantment> enchantment) Gets the gameplay level of the target enchantment on this stack.default booleanIItemExtension.isPrimaryItemFor(ItemStack stack, Holder<Enchantment> enchantment) Checks if an item should be treated as a primary item for a given enchantment.default booleanIItemStackExtension.isPrimaryItemFor(Holder<Enchantment> enchantment) -
Uses of Enchantment in net.neoforged.neoforge.debug.loot
Fields in net.neoforged.neoforge.debug.loot with type parameters of type EnchantmentModifier and TypeFieldDescriptionprivate static final ResourceKey<Enchantment> GlobalLootModifiersTest.SMELT -
Uses of Enchantment in net.neoforged.neoforge.event
Method parameters in net.neoforged.neoforge.event with type arguments of type EnchantmentModifier and TypeMethodDescriptionstatic ItemEnchantmentsEventHooks.getAllEnchantmentLevels(ItemEnchantments enchantments, ItemStack stack, HolderLookup.RegistryLookup<Enchantment> lookup) FiresGetEnchantmentLevelEventand for all enchantments, returning the (possibly event-modified) enchantment map.static intEventHooks.getEnchantmentLevelSpecific(int level, ItemStack stack, Holder<Enchantment> ench) FiresGetEnchantmentLevelEventand for a single enchantment, returning the (possibly event-modified) level. -
Uses of Enchantment in net.neoforged.neoforge.event.enchanting
Fields in net.neoforged.neoforge.event.enchanting with type parameters of type EnchantmentModifier and TypeFieldDescriptionprotected final HolderLookup.RegistryLookup<Enchantment> GetEnchantmentLevelEvent.lookupprotected final @Nullable Holder<Enchantment> GetEnchantmentLevelEvent.targetEnchantMethods in net.neoforged.neoforge.event.enchanting that return types with arguments of type EnchantmentModifier and TypeMethodDescriptionGetEnchantmentLevelEvent.getHolder(ResourceKey<Enchantment> key) Attempts to resolve aHolder.Referencefor 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 from.invalid reference
IItemStackExtension#getEnchantmentLevel(Enchantment)Method parameters in net.neoforged.neoforge.event.enchanting with type arguments of type EnchantmentModifier and TypeMethodDescriptionGetEnchantmentLevelEvent.getHolder(ResourceKey<Enchantment> key) Attempts to resolve aHolder.Referencefor a target enchantment.booleanGetEnchantmentLevelEvent.isTargetting(Holder<Enchantment> ench) Helper method aroundGetEnchantmentLevelEvent.getTargetEnchant()that checks if the target is the specified enchantment, or if the target is null.booleanGetEnchantmentLevelEvent.isTargetting(ResourceKey<Enchantment> ench) Helper method aroundGetEnchantmentLevelEvent.getTargetEnchant()that checks if the target is the specified enchantment, or if the target is null.Constructor parameters in net.neoforged.neoforge.event.enchanting with type arguments of type EnchantmentModifierConstructorDescriptionGetEnchantmentLevelEvent(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.