Uses of Record Class
net.minecraft.enchantment.Enchantment
Package
Description
-
Uses of Enchantment in net.minecraft.command.argument
Modifier and TypeMethodDescriptionstatic RegistryEntry.Reference
<Enchantment> RegistryEntryReferenceArgumentType.getEnchantment
(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, String name) -
Uses of Enchantment in net.minecraft.component.type
Modifier and TypeFieldDescriptionprivate final Object2IntOpenHashMap
<RegistryEntry<Enchantment>> ItemEnchantmentsComponent.Builder.enchantments
(package private) final Object2IntOpenHashMap
<RegistryEntry<Enchantment>> ItemEnchantmentsComponent.enchantments
private static final com.mojang.serialization.Codec
<Object2IntOpenHashMap<RegistryEntry<Enchantment>>> ItemEnchantmentsComponent.INLINE_CODEC
Modifier and TypeMethodDescriptionItemEnchantmentsComponent.Builder.getEnchantments()
ItemEnchantmentsComponent.getEnchantments()
ItemEnchantmentsComponent.getEnchantmentsMap()
Modifier and TypeMethodDescriptionvoid
ItemEnchantmentsComponent.Builder.add
(RegistryEntry<Enchantment> enchantment, int level) int
ItemEnchantmentsComponent.Builder.getLevel
(RegistryEntry<Enchantment> enchantment) int
ItemEnchantmentsComponent.getLevel
(RegistryEntry<Enchantment> enchantment) void
ItemEnchantmentsComponent.Builder.remove
(Predicate<RegistryEntry<Enchantment>> predicate) void
ItemEnchantmentsComponent.Builder.set
(RegistryEntry<Enchantment> enchantment, int level) ModifierConstructorDescription(package private)
ItemEnchantmentsComponent
(Object2IntOpenHashMap<RegistryEntry<Enchantment>> enchantments, boolean showInTooltip) -
Uses of Enchantment in net.minecraft.data.server.loottable.vanilla
Modifier and TypeMethodDescriptionstatic LootTable.Builder
VanillaEquipmentLootTableGenerator.createEquipmentTableBuilder
(Item helmet, Item chestplate, ArmorTrim trim, RegistryWrapper.Impl<Enchantment> enchantmentRegistryWrapper) -
Uses of Enchantment in net.minecraft.enchantment
Modifier and TypeFieldDescriptionstatic final RegistryKey
<Enchantment> Enchantments.AQUA_AFFINITY
static final RegistryKey
<Enchantment> Enchantments.BANE_OF_ARTHROPODS
static final RegistryKey
<Enchantment> Enchantments.BINDING_CURSE
static final RegistryKey
<Enchantment> Enchantments.BLAST_PROTECTION
static final RegistryKey
<Enchantment> Enchantments.BREACH
static final RegistryKey
<Enchantment> Enchantments.CHANNELING
static final com.mojang.serialization.Codec
<Enchantment> Enchantment.CODEC
static final RegistryKey
<Enchantment> Enchantments.DENSITY
static final RegistryKey
<Enchantment> Enchantments.DEPTH_STRIDER
static final RegistryKey
<Enchantment> Enchantments.EFFICIENCY
final RegistryEntry
<Enchantment> EnchantmentLevelEntry.enchantment
static final com.mojang.serialization.Codec
<RegistryEntry<Enchantment>> Enchantment.ENTRY_CODEC
static final PacketCodec
<RegistryByteBuf, RegistryEntry<Enchantment>> Enchantment.ENTRY_PACKET_CODEC
private RegistryEntryList
<Enchantment> Enchantment.Builder.exclusiveSet
private final RegistryEntryList
<Enchantment> Enchantment.exclusiveSet
The field for theexclusiveSet
record component.static final RegistryKey
<Enchantment> Enchantments.FEATHER_FALLING
static final RegistryKey
<Enchantment> Enchantments.FIRE_ASPECT
static final RegistryKey
<Enchantment> Enchantments.FIRE_PROTECTION
static final RegistryKey
<Enchantment> Enchantments.FLAME
static final RegistryKey
<Enchantment> Enchantments.FORTUNE
static final RegistryKey
<Enchantment> Enchantments.FROST_WALKER
static final RegistryKey
<Enchantment> Enchantments.IMPALING
static final RegistryKey
<Enchantment> Enchantments.INFINITY
static final RegistryKey
<Enchantment> Enchantments.KNOCKBACK
static final RegistryKey
<Enchantment> Enchantments.LOOTING
static final RegistryKey
<Enchantment> Enchantments.LOYALTY
static final RegistryKey
<Enchantment> Enchantments.LUCK_OF_THE_SEA
static final RegistryKey
<Enchantment> Enchantments.LURE
static final RegistryKey
<Enchantment> Enchantments.MENDING
static final RegistryKey
<Enchantment> Enchantments.MULTISHOT
static final RegistryKey
<Enchantment> Enchantments.PIERCING
static final RegistryKey
<Enchantment> Enchantments.POWER
static final RegistryKey
<Enchantment> Enchantments.PROJECTILE_PROTECTION
static final RegistryKey
<Enchantment> Enchantments.PROTECTION
static final RegistryKey
<Enchantment> Enchantments.PUNCH
static final RegistryKey
<Enchantment> Enchantments.QUICK_CHARGE
static final RegistryKey
<Enchantment> Enchantments.RESPIRATION
static final RegistryKey
<Enchantment> Enchantments.RIPTIDE
static final RegistryKey
<Enchantment> Enchantments.SHARPNESS
static final RegistryKey
<Enchantment> Enchantments.SILK_TOUCH
static final RegistryKey
<Enchantment> Enchantments.SMITE
static final RegistryKey
<Enchantment> Enchantments.SOUL_SPEED
static final RegistryKey
<Enchantment> Enchantments.SWEEPING_EDGE
static final RegistryKey
<Enchantment> Enchantments.SWIFT_SNEAK
static final RegistryKey
<Enchantment> Enchantments.THORNS
static final RegistryKey
<Enchantment> Enchantments.UNBREAKING
static final RegistryKey
<Enchantment> Enchantments.VANISHING_CURSE
static final RegistryKey
<Enchantment> Enchantments.WIND_BURST
Modifier and TypeMethodDescriptionEnchantment.exclusiveSet()
Returns the value of theexclusiveSet
record component.private static RegistryKey
<Enchantment> Modifier and TypeMethodDescriptionvoid
EnchantmentHelper.Consumer.accept
(RegistryEntry<Enchantment> enchantment, int level) void
EnchantmentHelper.ContextAwareConsumer.accept
(RegistryEntry<Enchantment> enchantment, int level, EnchantmentEffectContext context) static void
Enchantments.bootstrap
(Registerable<Enchantment> registry) static boolean
Enchantment.canBeCombined
(RegistryEntry<Enchantment> first, RegistryEntry<Enchantment> second) static ItemStack
EnchantmentHelper.enchant
(Random random, ItemStack stack, int level, Stream<RegistryEntry<Enchantment>> possibleEnchantments) Enchants thetarget
item stack and returns it.static ItemStack
EnchantmentHelper.enchant
(Random random, ItemStack stack, int level, DynamicRegistryManager dynamicRegistryManager, Optional<? extends RegistryEntryList<Enchantment>> enchantments) Enchantment.Builder.exclusiveSet
(RegistryEntryList<Enchantment> exclusiveSet) static List
<EnchantmentLevelEntry> EnchantmentHelper.generateEnchantments
(Random random, ItemStack stack, int level, Stream<RegistryEntry<Enchantment>> possibleEnchantments) Generate the enchantments for enchanting thestack
.static int
EnchantmentHelper.getEquipmentLevel
(RegistryEntry<Enchantment> enchantment, LivingEntity entity) Returns the highest level of the passed enchantment in the enchantment's applicable equipment slots' item stacks.static int
EnchantmentHelper.getLevel
(RegistryEntry<Enchantment> enchantment, ItemStack stack) Gets the level of an enchantment on an item stack.static Text
Enchantment.getName
(RegistryEntry<Enchantment> enchantment, int level) static List
<EnchantmentLevelEntry> EnchantmentHelper.getPossibleEntries
(int level, ItemStack stack, Stream<RegistryEntry<Enchantment>> possibleEnchantments) Gets all the possible entries for enchanting thestack
at the givenpower
.static boolean
EnchantmentHelper.hasAnyEnchantmentsIn
(ItemStack stack, TagKey<Enchantment> tag) static boolean
EnchantmentHelper.isCompatible
(Collection<RegistryEntry<Enchantment>> existing, RegistryEntry<Enchantment> candidate) Returns whether thecandidate
enchantment is compatible with theexisting
enchantments.static boolean
EnchantmentHelper.isCompatible
(Collection<RegistryEntry<Enchantment>> existing, RegistryEntry<Enchantment> candidate) Returns whether thecandidate
enchantment is compatible with theexisting
enchantments.private static void
Enchantments.register
(Registerable<Enchantment> registry, RegistryKey<Enchantment> key, Enchantment.Builder builder) private static void
Enchantments.register
(Registerable<Enchantment> registry, RegistryKey<Enchantment> key, Enchantment.Builder builder) ModifierConstructorDescriptionEnchantment
(Text text, Enchantment.Definition definition, RegistryEntryList<Enchantment> registryEntryList, ComponentMap componentMap) EnchantmentLevelEntry
(RegistryEntry<Enchantment> enchantment, int level) -
Uses of Enchantment in net.minecraft.enchantment.provider
Modifier and TypeFieldDescriptionprivate final RegistryEntry
<Enchantment> SingleEnchantmentProvider.enchantment
The field for theenchantment
record component.private final RegistryEntryList
<Enchantment> ByCostEnchantmentProvider.enchantments
The field for theenchantments
record component.private final RegistryEntryList
<Enchantment> ByCostWithDifficultyEnchantmentProvider.enchantments
The field for theenchantments
record component.Modifier and TypeMethodDescriptionSingleEnchantmentProvider.enchantment()
Returns the value of theenchantment
record component.ByCostEnchantmentProvider.enchantments()
Returns the value of theenchantments
record component.ByCostWithDifficultyEnchantmentProvider.enchantments()
Returns the value of theenchantments
record component.ModifierConstructorDescriptionByCostEnchantmentProvider
(RegistryEntryList<Enchantment> registryEntryList, IntProvider intProvider) ByCostWithDifficultyEnchantmentProvider
(RegistryEntryList<Enchantment> registryEntryList, int int2, int int3) SingleEnchantmentProvider
(RegistryEntry<Enchantment> registryEntry, IntProvider intProvider) -
Uses of Enchantment in net.minecraft.entity
Modifier and TypeFieldDescriptionprivate final Reference2ObjectMap
<Enchantment, Set<EnchantmentLocationBasedEffectType>> LivingEntity.locationBasedEnchantmentEffects
-
Uses of Enchantment in net.minecraft.item
Modifier and TypeMethodDescriptionprivate static void
ItemGroups.addAllLevelEnchantedBooks
(ItemGroup.Entries entries, RegistryWrapper<Enchantment> registryWrapper, ItemGroup.StackVisibility stackVisibility) void
ItemStack.addEnchantment
(RegistryEntry<Enchantment> enchantment, int level) Enchants this item with the given enchantment and level.private static void
ItemGroups.addMaxLevelEnchantedBooks
(ItemGroup.Entries entries, RegistryWrapper<Enchantment> registryWrapper, ItemGroup.StackVisibility stackVisibility) -
Uses of Enchantment in net.minecraft.loot.condition
Modifier and TypeFieldDescriptionprivate final RegistryEntry
<Enchantment> RandomChanceWithEnchantedBonusLootCondition.enchantment
The field for theenchantment
record component.private final RegistryEntry
<Enchantment> TableBonusLootCondition.enchantment
The field for theenchantment
record component.Modifier and TypeMethodDescriptionRandomChanceWithEnchantedBonusLootCondition.enchantment()
Returns the value of theenchantment
record component.TableBonusLootCondition.enchantment()
Returns the value of theenchantment
record component.Modifier and TypeMethodDescriptionstatic LootCondition.Builder
TableBonusLootCondition.builder
(RegistryEntry<Enchantment> enchantment, float[] chances) ModifierConstructorDescriptionRandomChanceWithEnchantedBonusLootCondition
(EnchantmentLevelBasedValueType enchantmentLevelBasedValueType, RegistryEntry<Enchantment> registryEntry) TableBonusLootCondition
(RegistryEntry<Enchantment> registryEntry, List<Float> list) -
Uses of Enchantment in net.minecraft.loot.function
Modifier and TypeFieldDescriptionprivate final RegistryEntry
<Enchantment> ApplyBonusLootFunction.enchantment
private final RegistryEntry
<Enchantment> EnchantedCountIncreaseLootFunction.Builder.enchantment
private final RegistryEntry
<Enchantment> EnchantedCountIncreaseLootFunction.enchantment
private final ImmutableMap.Builder
<RegistryEntry<Enchantment>, LootNumberProvider> SetEnchantmentsLootFunction.Builder.enchantments
private final Map
<RegistryEntry<Enchantment>, LootNumberProvider> SetEnchantmentsLootFunction.enchantments
private Optional
<RegistryEntryList<Enchantment>> EnchantRandomlyLootFunction.Builder.options
private final Optional
<RegistryEntryList<Enchantment>> EnchantRandomlyLootFunction.options
private Optional
<RegistryEntryList<Enchantment>> EnchantWithLevelsLootFunction.Builder.options
private final Optional
<RegistryEntryList<Enchantment>> EnchantWithLevelsLootFunction.options
Modifier and TypeMethodDescriptionprivate static ItemStack
EnchantRandomlyLootFunction.addEnchantmentToStack
(ItemStack stack, RegistryEntry<Enchantment> enchantment, Random random) static ConditionalLootFunction.Builder
<?> ApplyBonusLootFunction.binomialWithBonusCount
(RegistryEntry<Enchantment> enchantment, float probability, int extra) SetEnchantmentsLootFunction.Builder.enchantment
(RegistryEntry<Enchantment> enchantment, LootNumberProvider level) EnchantRandomlyLootFunction.Builder.option
(RegistryEntry<Enchantment> enchantment) EnchantRandomlyLootFunction.Builder.options
(RegistryEntryList<Enchantment> options) EnchantWithLevelsLootFunction.Builder.options
(RegistryEntryList<Enchantment> options) static ConditionalLootFunction.Builder
<?> ApplyBonusLootFunction.oreDrops
(RegistryEntry<Enchantment> enchantment) static ConditionalLootFunction.Builder
<?> ApplyBonusLootFunction.uniformBonusCount
(RegistryEntry<Enchantment> enchantment) static ConditionalLootFunction.Builder
<?> ApplyBonusLootFunction.uniformBonusCount
(RegistryEntry<Enchantment> enchantment, int bonusMultiplier) ModifierConstructorDescriptionprivate
ApplyBonusLootFunction
(List<LootCondition> conditions, RegistryEntry<Enchantment> enchantment, ApplyBonusLootFunction.Formula formula) Builder
(RegistryEntry<Enchantment> enchantment, LootNumberProvider count) (package private)
EnchantedCountIncreaseLootFunction
(List<LootCondition> conditions, RegistryEntry<Enchantment> enchantment, LootNumberProvider count, int limit) (package private)
EnchantRandomlyLootFunction
(List<LootCondition> conditions, Optional<RegistryEntryList<Enchantment>> options, boolean onlyCompatible) (package private)
EnchantWithLevelsLootFunction
(List<LootCondition> conditions, LootNumberProvider levels, Optional<RegistryEntryList<Enchantment>> options) (package private)
SetEnchantmentsLootFunction
(List<LootCondition> conditions, Map<RegistryEntry<Enchantment>, LootNumberProvider> enchantments, boolean add) -
Uses of Enchantment in net.minecraft.predicate.item
Modifier and TypeFieldDescriptionprivate final Optional
<RegistryEntryList<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.testLevel
(ItemEnchantmentsComponent enchantmentsComponent, RegistryEntry<Enchantment> enchantment) ModifierConstructorDescriptionEnchantmentPredicate
(Optional<RegistryEntryList<Enchantment>> optional, NumberRange.IntRange intRange) EnchantmentPredicate
(RegistryEntry<Enchantment> enchantment, NumberRange.IntRange levels) EnchantmentPredicate
(RegistryEntryList<Enchantment> enchantments, NumberRange.IntRange levels) -
Uses of Enchantment in net.minecraft.registry
Modifier and TypeFieldDescriptionstatic final RegistryKey
<Registry<Enchantment>> RegistryKeys.ENCHANTMENT
-
Uses of Enchantment in net.minecraft.registry.tag
Modifier and TypeFieldDescriptionstatic final TagKey
<Enchantment> EnchantmentTags.ARMOR_EXCLUSIVE_SET
static final TagKey
<Enchantment> EnchantmentTags.BOOTS_EXCLUSIVE_SET
static final TagKey
<Enchantment> EnchantmentTags.BOW_EXCLUSIVE_SET
static final TagKey
<Enchantment> EnchantmentTags.CROSSBOW_EXCLUSIVE_SET
static final TagKey
<Enchantment> EnchantmentTags.CURSE
static final TagKey
<Enchantment> EnchantmentTags.DAMAGE_EXCLUSIVE_SET
static final TagKey
<Enchantment> EnchantmentTags.DESERT_COMMON_TRADE
static final TagKey
<Enchantment> EnchantmentTags.DESERT_SPECIAL_TRADE
static final TagKey
<Enchantment> EnchantmentTags.DOUBLE_TRADE_PRICE
static final TagKey
<Enchantment> EnchantmentTags.IN_ENCHANTING_TABLE
static final TagKey
<Enchantment> EnchantmentTags.JUNGLE_COMMON_TRADE
static final TagKey
<Enchantment> EnchantmentTags.JUNGLE_SPECIAL_TRADE
static final TagKey
<Enchantment> EnchantmentTags.MINING_EXCLUSIVE_SET
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.PLAINS_COMMON_TRADE
static final TagKey
<Enchantment> EnchantmentTags.PLAINS_SPECIAL_TRADE
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_SET
static final TagKey
<Enchantment> EnchantmentTags.SAVANNA_COMMON_TRADE
static final TagKey
<Enchantment> EnchantmentTags.SAVANNA_SPECIAL_TRADE
static final TagKey
<Enchantment> EnchantmentTags.SMELTS_LOOT
static final TagKey
<Enchantment> EnchantmentTags.SNOW_COMMON_TRADE
static final TagKey
<Enchantment> EnchantmentTags.SNOW_SPECIAL_TRADE
static final TagKey
<Enchantment> EnchantmentTags.SWAMP_COMMON_TRADE
static final TagKey
<Enchantment> EnchantmentTags.SWAMP_SPECIAL_TRADE
static final TagKey
<Enchantment> EnchantmentTags.TAIGA_COMMON_TRADE
static final TagKey
<Enchantment> EnchantmentTags.TAIGA_SPECIAL_TRADE
static final TagKey
<Enchantment> EnchantmentTags.TOOLTIP_ORDER
static final TagKey
<Enchantment> EnchantmentTags.TRADEABLE
static final TagKey
<Enchantment> EnchantmentTags.TREASURE
-
Uses of Enchantment in net.minecraft.server.command
Modifier and TypeMethodDescriptionprivate static int
EnchantCommand.execute
(ServerCommandSource source, Collection<? extends Entity> targets, RegistryEntry<Enchantment> enchantment, int level) -
Uses of Enchantment in net.minecraft.village
Modifier and TypeFieldDescriptionprivate final TagKey
<Enchantment> TradeOffers.EnchantBookFactory.possibleEnchantments
ModifierConstructorDescriptionEnchantBookFactory
(int experience, int minLevel, int maxLevel, TagKey<Enchantment> possibleEnchantments) EnchantBookFactory
(int experience, TagKey<Enchantment> possibleEnchantments)