Package net.minecraft.enchantment
Class EnchantmentHelper
java.lang.Object
net.minecraft.enchantment.EnchantmentHelper
- Mappings:
Namespace Name named net/minecraft/enchantment/EnchantmentHelper
intermediary net/minecraft/class_1890
official czo
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static interface
private static interface
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ItemEnchantmentsComponent
apply
(ItemStack stack, Consumer<ItemEnchantmentsComponent.Builder> applier) static void
applyAttributeModifiers
(ItemStack stack, AttributeModifierSlot slot, BiConsumer<RegistryEntry<EntityAttribute>, EntityAttributeModifier> attributeModifierConsumer) static void
applyAttributeModifiers
(ItemStack stack, EquipmentSlot slot, BiConsumer<RegistryEntry<EntityAttribute>, EntityAttributeModifier> attributeModifierConsumer) static void
applyEnchantmentProvider
(ItemStack stack, DynamicRegistryManager registryManager, RegistryKey<EnchantmentProvider> providerKey, LocalDifficulty localDifficulty, Random random) static void
applyLocationBasedEffects
(ServerWorld world, LivingEntity user) static void
applyLocationBasedEffects
(ServerWorld world, ItemStack stack, LivingEntity user, EquipmentSlot slot) static int
calculateRequiredExperienceLevel
(Random random, int slotIndex, int bookshelfCount, ItemStack stack) Returns the required experience level for an enchanting option in the enchanting table's screen, or the enchantment screen.static boolean
canHaveEnchantments
(ItemStack stack) static Optional
<EnchantmentEffectContext> chooseEquipmentWith
(ComponentType<?> componentType, LivingEntity entity, Predicate<ItemStack> stackPredicate) Returns a pair of an equipment slot and the item stack in the supplied entity's slot.static ItemStack
enchant
(Random random, ItemStack stack, int level, Stream<RegistryEntry<Enchantment>> possibleEnchantments) Enchants thetarget
item stack and returns it.static ItemStack
enchant
(Random random, ItemStack stack, int level, DynamicRegistryManager dynamicRegistryManager, Optional<? extends RegistryEntryList<Enchantment>> enchantments) private static void
forEachEnchantment
(LivingEntity entity, EnchantmentHelper.ContextAwareConsumer contextAwareConsumer) private static void
forEachEnchantment
(ItemStack stack, EnchantmentHelper.Consumer consumer) private static void
forEachEnchantment
(ItemStack stack, EquipmentSlot slot, LivingEntity entity, EnchantmentHelper.ContextAwareConsumer contextAwareConsumer) static List
<EnchantmentLevelEntry> generateEnchantments
(Random random, ItemStack stack, int level, Stream<RegistryEntry<Enchantment>> possibleEnchantments) Generate the enchantments for enchanting thestack
.static int
getAmmoUse
(ServerWorld world, ItemStack rangedWeaponStack, ItemStack projectileStack, int baseAmmoUse) static float
getArmorEffectiveness
(ServerWorld world, ItemStack stack, Entity user, DamageSource damageSource, float baseArmorEffectiveness) static int
getBlockExperience
(ServerWorld world, ItemStack stack, int baseBlockExperience) static float
getCrossbowChargeTime
(LivingEntity user, float baseCrossbowChargeTime) static float
getDamage
(ServerWorld world, ItemStack stack, Entity target, DamageSource damageSource, float baseDamage) static <T> Optional
<T> getEffect
(ItemStack stack, ComponentType<List<T>> componentType) getEffectListAndLevel
(ItemStack stack, ComponentType<T> componentType) static ItemEnchantmentsComponent
getEnchantments
(ItemStack stack) private static ComponentType
<ItemEnchantmentsComponent> static float
getEquipmentDropChance
(ServerWorld world, LivingEntity attacker, DamageSource damageSource, float baseEquipmentDropChance) static int
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
getFishingLuckBonus
(ServerWorld world, ItemStack stack, Entity user) static float
getFishingTimeReduction
(ServerWorld world, ItemStack stack, Entity user) static int
getItemDamage
(ServerWorld world, ItemStack stack, int baseItemDamage) static int
getLevel
(RegistryEntry<Enchantment> enchantment, ItemStack stack) Gets the level of an enchantment on an item stack.static int
getMobExperience
(ServerWorld world, @Nullable Entity attacker, Entity mob, int baseMobExperience) static List
<EnchantmentLevelEntry> getPossibleEntries
(int level, ItemStack stack, Stream<RegistryEntry<Enchantment>> possibleEnchantments) Gets all the possible entries for enchanting thestack
at the givenpower
.static int
getProjectileCount
(ServerWorld world, ItemStack stack, Entity user, int baseProjectileCount) static int
getProjectilePiercing
(ServerWorld world, ItemStack weaponStack, ItemStack projectileStack) static float
getProjectileSpread
(ServerWorld world, ItemStack stack, Entity user, float baseProjectileSpread) static float
getProtectionAmount
(ServerWorld world, LivingEntity user, DamageSource damageSource) static int
getRepairWithXp
(ServerWorld world, ItemStack stack, int baseRepairWithXp) static float
getSmashDamagePerFallenBlock
(ServerWorld world, ItemStack stack, Entity target, DamageSource damageSource, float baseSmashDamagePerFallenBlock) static int
getTridentReturnAcceleration
(ServerWorld world, ItemStack stack, Entity user) static float
static boolean
hasAnyEnchantmentsIn
(ItemStack stack, TagKey<Enchantment> tag) static boolean
hasAnyEnchantmentsWith
(ItemStack stack, ComponentType<?> componentType) static boolean
hasEnchantments
(ItemStack stack) static boolean
isCompatible
(Collection<RegistryEntry<Enchantment>> existing, RegistryEntry<Enchantment> candidate) Returns whether thecandidate
enchantment is compatible with theexisting
enchantments.static boolean
isInvulnerableTo
(ServerWorld world, LivingEntity user, DamageSource damageSource) static float
modifyKnockback
(ServerWorld world, ItemStack stack, Entity target, DamageSource damageSource, float baseKnockback) static void
onHitBlock
(ServerWorld world, ItemStack stack, @Nullable LivingEntity user, Entity enchantedEntity, @Nullable EquipmentSlot slot, Vec3d pos, Consumer<Item> onBreak) static void
onProjectileSpawned
(ServerWorld world, ItemStack weaponStack, PersistentProjectileEntity projectileEntity, Consumer<Item> onBreak) static void
onTargetDamaged
(ServerWorld world, Entity target, DamageSource damageSource) static void
onTargetDamaged
(ServerWorld world, Entity target, DamageSource damageSource, @Nullable ItemStack weapon) static void
onTick
(ServerWorld world, LivingEntity user) static void
removeConflicts
(List<EnchantmentLevelEntry> possibleEntries, EnchantmentLevelEntry pickedEntry) Remove entries conflicting with the picked entry from the possible entries.static void
static void
removeLocationBasedEffects
(ItemStack stack, LivingEntity user, EquipmentSlot slot) static void
set
(ItemStack stack, ItemEnchantmentsComponent enchantments)
-
Constructor Details
-
EnchantmentHelper
public EnchantmentHelper()
-
-
Method Details
-
getLevel
Gets the level of an enchantment on an item stack.- Mappings:
Namespace Name Mixin selector named getLevel
Lnet/minecraft/enchantment/EnchantmentHelper;getLevel(Lnet/minecraft/registry/entry/RegistryEntry;Lnet/minecraft/item/ItemStack;)I
intermediary method_8225
Lnet/minecraft/class_1890;method_8225(Lnet/minecraft/class_6880;Lnet/minecraft/class_1799;)I
official a
Lczo;a(Ljj;Lcud;)I
-
apply
public static ItemEnchantmentsComponent apply(ItemStack stack, Consumer<ItemEnchantmentsComponent.Builder> applier) - Mappings:
Namespace Name Mixin selector named apply
Lnet/minecraft/enchantment/EnchantmentHelper;apply(Lnet/minecraft/item/ItemStack;Ljava/util/function/Consumer;)Lnet/minecraft/component/type/ItemEnchantmentsComponent;
intermediary method_57531
Lnet/minecraft/class_1890;method_57531(Lnet/minecraft/class_1799;Ljava/util/function/Consumer;)Lnet/minecraft/class_9304;
official a
Lczo;a(Lcud;Ljava/util/function/Consumer;)Lczs;
-
canHaveEnchantments
- Mappings:
Namespace Name Mixin selector named canHaveEnchantments
Lnet/minecraft/enchantment/EnchantmentHelper;canHaveEnchantments(Lnet/minecraft/item/ItemStack;)Z
intermediary method_57529
Lnet/minecraft/class_1890;method_57529(Lnet/minecraft/class_1799;)Z
official a
Lczo;a(Lcud;)Z
-
set
- Mappings:
Namespace Name Mixin selector named set
Lnet/minecraft/enchantment/EnchantmentHelper;set(Lnet/minecraft/item/ItemStack;Lnet/minecraft/component/type/ItemEnchantmentsComponent;)V
intermediary method_57530
Lnet/minecraft/class_1890;method_57530(Lnet/minecraft/class_1799;Lnet/minecraft/class_9304;)V
official a
Lczo;a(Lcud;Lczs;)V
-
getEnchantments
- Mappings:
Namespace Name Mixin selector named getEnchantments
Lnet/minecraft/enchantment/EnchantmentHelper;getEnchantments(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/component/type/ItemEnchantmentsComponent;
intermediary method_57532
Lnet/minecraft/class_1890;method_57532(Lnet/minecraft/class_1799;)Lnet/minecraft/class_9304;
official b
Lczo;b(Lcud;)Lczs;
-
getEnchantmentsComponentType
private static ComponentType<ItemEnchantmentsComponent> getEnchantmentsComponentType(ItemStack stack) - Mappings:
Namespace Name Mixin selector named getEnchantmentsComponentType
Lnet/minecraft/enchantment/EnchantmentHelper;getEnchantmentsComponentType(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/component/ComponentType;
intermediary method_57533
Lnet/minecraft/class_1890;method_57533(Lnet/minecraft/class_1799;)Lnet/minecraft/class_9331;
official d
Lczo;d(Lcud;)Lkm;
-
hasEnchantments
- Mappings:
Namespace Name Mixin selector named hasEnchantments
Lnet/minecraft/enchantment/EnchantmentHelper;hasEnchantments(Lnet/minecraft/item/ItemStack;)Z
intermediary method_58117
Lnet/minecraft/class_1890;method_58117(Lnet/minecraft/class_1799;)Z
official c
Lczo;c(Lcud;)Z
-
getItemDamage
- Mappings:
Namespace Name Mixin selector named getItemDamage
Lnet/minecraft/enchantment/EnchantmentHelper;getItemDamage(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;I)I
intermediary method_60117
Lnet/minecraft/class_1890;method_60117(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;I)I
official a
Lczo;a(Laqm;Lcud;I)I
-
getAmmoUse
public static int getAmmoUse(ServerWorld world, ItemStack rangedWeaponStack, ItemStack projectileStack, int baseAmmoUse) - Mappings:
Namespace Name Mixin selector named getAmmoUse
Lnet/minecraft/enchantment/EnchantmentHelper;getAmmoUse(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;I)I
intermediary method_60129
Lnet/minecraft/class_1890;method_60129(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;I)I
official a
Lczo;a(Laqm;Lcud;Lcud;I)I
-
getBlockExperience
- Mappings:
Namespace Name Mixin selector named getBlockExperience
Lnet/minecraft/enchantment/EnchantmentHelper;getBlockExperience(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;I)I
intermediary method_60157
Lnet/minecraft/class_1890;method_60157(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;I)I
official b
Lczo;b(Laqm;Lcud;I)I
-
getMobExperience
public static int getMobExperience(ServerWorld world, @Nullable @Nullable Entity attacker, Entity mob, int baseMobExperience) - Mappings:
Namespace Name Mixin selector named getMobExperience
Lnet/minecraft/enchantment/EnchantmentHelper;getMobExperience(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/Entity;I)I
intermediary method_60109
Lnet/minecraft/class_1890;method_60109(Lnet/minecraft/class_3218;Lnet/minecraft/class_1297;Lnet/minecraft/class_1297;I)I
official a
Lczo;a(Laqm;Lbsh;Lbsh;I)I
-
forEachEnchantment
- Mappings:
Namespace Name Mixin selector named forEachEnchantment
Lnet/minecraft/enchantment/EnchantmentHelper;forEachEnchantment(Lnet/minecraft/item/ItemStack;Lnet/minecraft/enchantment/EnchantmentHelper$Consumer;)V
intermediary method_8220
Lnet/minecraft/class_1890;method_8220(Lnet/minecraft/class_1799;Lnet/minecraft/class_1890$class_1891;)V
official a
Lczo;a(Lcud;Lczo$b;)V
-
forEachEnchantment
private static void forEachEnchantment(ItemStack stack, EquipmentSlot slot, LivingEntity entity, EnchantmentHelper.ContextAwareConsumer contextAwareConsumer) - Mappings:
Namespace Name Mixin selector named forEachEnchantment
Lnet/minecraft/enchantment/EnchantmentHelper;forEachEnchantment(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/EquipmentSlot;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/enchantment/EnchantmentHelper$ContextAwareConsumer;)V
intermediary method_60139
Lnet/minecraft/class_1890;method_60139(Lnet/minecraft/class_1799;Lnet/minecraft/class_1304;Lnet/minecraft/class_1309;Lnet/minecraft/class_1890$class_9702;)V
official a
Lczo;a(Lcud;Lbso;Lbtc;Lczo$a;)V
-
forEachEnchantment
private static void forEachEnchantment(LivingEntity entity, EnchantmentHelper.ContextAwareConsumer contextAwareConsumer) - Mappings:
Namespace Name Mixin selector named forEachEnchantment
Lnet/minecraft/enchantment/EnchantmentHelper;forEachEnchantment(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/enchantment/EnchantmentHelper$ContextAwareConsumer;)V
intermediary method_8209
Lnet/minecraft/class_1890;method_8209(Lnet/minecraft/class_1309;Lnet/minecraft/class_1890$class_9702;)V
official a
Lczo;a(Lbtc;Lczo$a;)V
-
isInvulnerableTo
public static boolean isInvulnerableTo(ServerWorld world, LivingEntity user, DamageSource damageSource) - Mappings:
Namespace Name Mixin selector named isInvulnerableTo
Lnet/minecraft/enchantment/EnchantmentHelper;isInvulnerableTo(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/damage/DamageSource;)Z
intermediary method_60112
Lnet/minecraft/class_1890;method_60112(Lnet/minecraft/class_3218;Lnet/minecraft/class_1309;Lnet/minecraft/class_1282;)Z
official a
Lczo;a(Laqm;Lbtc;Lbra;)Z
-
getProtectionAmount
public static float getProtectionAmount(ServerWorld world, LivingEntity user, DamageSource damageSource) - Mappings:
Namespace Name Mixin selector named getProtectionAmount
Lnet/minecraft/enchantment/EnchantmentHelper;getProtectionAmount(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/damage/DamageSource;)F
intermediary method_8219
Lnet/minecraft/class_1890;method_8219(Lnet/minecraft/class_3218;Lnet/minecraft/class_1309;Lnet/minecraft/class_1282;)F
official b
Lczo;b(Laqm;Lbtc;Lbra;)F
-
getDamage
public static float getDamage(ServerWorld world, ItemStack stack, Entity target, DamageSource damageSource, float baseDamage) - Mappings:
Namespace Name Mixin selector named getDamage
Lnet/minecraft/enchantment/EnchantmentHelper;getDamage(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/damage/DamageSource;F)F
intermediary method_60120
Lnet/minecraft/class_1890;method_60120(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;Lnet/minecraft/class_1282;F)F
official a
Lczo;a(Laqm;Lcud;Lbsh;Lbra;F)F
-
getSmashDamagePerFallenBlock
public static float getSmashDamagePerFallenBlock(ServerWorld world, ItemStack stack, Entity target, DamageSource damageSource, float baseSmashDamagePerFallenBlock) - Mappings:
Namespace Name Mixin selector named getSmashDamagePerFallenBlock
Lnet/minecraft/enchantment/EnchantmentHelper;getSmashDamagePerFallenBlock(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/damage/DamageSource;F)F
intermediary method_60160
Lnet/minecraft/class_1890;method_60160(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;Lnet/minecraft/class_1282;F)F
official b
Lczo;b(Laqm;Lcud;Lbsh;Lbra;F)F
-
getArmorEffectiveness
public static float getArmorEffectiveness(ServerWorld world, ItemStack stack, Entity user, DamageSource damageSource, float baseArmorEffectiveness) - Mappings:
Namespace Name Mixin selector named getArmorEffectiveness
Lnet/minecraft/enchantment/EnchantmentHelper;getArmorEffectiveness(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/damage/DamageSource;F)F
intermediary method_60170
Lnet/minecraft/class_1890;method_60170(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;Lnet/minecraft/class_1282;F)F
official c
Lczo;c(Laqm;Lcud;Lbsh;Lbra;F)F
-
modifyKnockback
public static float modifyKnockback(ServerWorld world, ItemStack stack, Entity target, DamageSource damageSource, float baseKnockback) - Mappings:
Namespace Name Mixin selector named modifyKnockback
Lnet/minecraft/enchantment/EnchantmentHelper;modifyKnockback(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/damage/DamageSource;F)F
intermediary method_60175
Lnet/minecraft/class_1890;method_60175(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;Lnet/minecraft/class_1282;F)F
official d
Lczo;d(Laqm;Lcud;Lbsh;Lbra;F)F
-
onTargetDamaged
- Mappings:
Namespace Name Mixin selector named onTargetDamaged
Lnet/minecraft/enchantment/EnchantmentHelper;onTargetDamaged(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/damage/DamageSource;)V
intermediary method_60107
Lnet/minecraft/class_1890;method_60107(Lnet/minecraft/class_3218;Lnet/minecraft/class_1297;Lnet/minecraft/class_1282;)V
official a
Lczo;a(Laqm;Lbsh;Lbra;)V
-
onTargetDamaged
public static void onTargetDamaged(ServerWorld world, Entity target, DamageSource damageSource, @Nullable @Nullable ItemStack weapon) - Mappings:
Namespace Name Mixin selector named onTargetDamaged
Lnet/minecraft/enchantment/EnchantmentHelper;onTargetDamaged(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/damage/DamageSource;Lnet/minecraft/item/ItemStack;)V
intermediary method_60619
Lnet/minecraft/class_1890;method_60619(Lnet/minecraft/class_3218;Lnet/minecraft/class_1297;Lnet/minecraft/class_1282;Lnet/minecraft/class_1799;)V
official a
Lczo;a(Laqm;Lbsh;Lbra;Lcud;)V
-
applyLocationBasedEffects
- Mappings:
Namespace Name Mixin selector named applyLocationBasedEffects
Lnet/minecraft/enchantment/EnchantmentHelper;applyLocationBasedEffects(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/LivingEntity;)V
intermediary method_60111
Lnet/minecraft/class_1890;method_60111(Lnet/minecraft/class_3218;Lnet/minecraft/class_1309;)V
official a
Lczo;a(Laqm;Lbtc;)V
-
applyLocationBasedEffects
public static void applyLocationBasedEffects(ServerWorld world, ItemStack stack, LivingEntity user, EquipmentSlot slot) - Mappings:
Namespace Name Mixin selector named applyLocationBasedEffects
Lnet/minecraft/enchantment/EnchantmentHelper;applyLocationBasedEffects(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/EquipmentSlot;)V
intermediary method_60125
Lnet/minecraft/class_1890;method_60125(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;)V
official a
Lczo;a(Laqm;Lcud;Lbtc;Lbso;)V
-
removeLocationBasedEffects
- Mappings:
Namespace Name Mixin selector named removeLocationBasedEffects
Lnet/minecraft/enchantment/EnchantmentHelper;removeLocationBasedEffects(Lnet/minecraft/entity/LivingEntity;)V
intermediary method_60135
Lnet/minecraft/class_1890;method_60135(Lnet/minecraft/class_1309;)V
official a
Lczo;a(Lbtc;)V
-
removeLocationBasedEffects
public static void removeLocationBasedEffects(ItemStack stack, LivingEntity user, EquipmentSlot slot) - Mappings:
Namespace Name Mixin selector named removeLocationBasedEffects
Lnet/minecraft/enchantment/EnchantmentHelper;removeLocationBasedEffects(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/EquipmentSlot;)V
intermediary method_60141
Lnet/minecraft/class_1890;method_60141(Lnet/minecraft/class_1799;Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;)V
official a
Lczo;a(Lcud;Lbtc;Lbso;)V
-
onTick
- Mappings:
Namespace Name Mixin selector named onTick
Lnet/minecraft/enchantment/EnchantmentHelper;onTick(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/LivingEntity;)V
intermediary method_60154
Lnet/minecraft/class_1890;method_60154(Lnet/minecraft/class_3218;Lnet/minecraft/class_1309;)V
official b
Lczo;b(Laqm;Lbtc;)V
-
getEquipmentLevel
Returns the highest level of the passed enchantment in the enchantment's applicable equipment slots' item stacks.- Parameters:
entity
- the entity whose equipment slots are checked- Returns:
- the highest level of the passed enchantment in the enchantment's applicable equipment slots' item stacks
- Mappings:
Namespace Name Mixin selector named getEquipmentLevel
Lnet/minecraft/enchantment/EnchantmentHelper;getEquipmentLevel(Lnet/minecraft/registry/entry/RegistryEntry;Lnet/minecraft/entity/LivingEntity;)I
intermediary method_8203
Lnet/minecraft/class_1890;method_8203(Lnet/minecraft/class_6880;Lnet/minecraft/class_1309;)I
official a
Lczo;a(Ljj;Lbtc;)I
-
getProjectileCount
public static int getProjectileCount(ServerWorld world, ItemStack stack, Entity user, int baseProjectileCount) - Mappings:
Namespace Name Mixin selector named getProjectileCount
Lnet/minecraft/enchantment/EnchantmentHelper;getProjectileCount(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;I)I
intermediary method_60119
Lnet/minecraft/class_1890;method_60119(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;I)I
official a
Lczo;a(Laqm;Lcud;Lbsh;I)I
-
getProjectileSpread
public static float getProjectileSpread(ServerWorld world, ItemStack stack, Entity user, float baseProjectileSpread) - Mappings:
Namespace Name Mixin selector named getProjectileSpread
Lnet/minecraft/enchantment/EnchantmentHelper;getProjectileSpread(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;F)F
intermediary method_60118
Lnet/minecraft/class_1890;method_60118(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;F)F
official a
Lczo;a(Laqm;Lcud;Lbsh;F)F
-
getProjectilePiercing
public static int getProjectilePiercing(ServerWorld world, ItemStack weaponStack, ItemStack projectileStack) - Mappings:
Namespace Name Mixin selector named getProjectilePiercing
Lnet/minecraft/enchantment/EnchantmentHelper;getProjectilePiercing(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)I
intermediary method_60128
Lnet/minecraft/class_1890;method_60128(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)I
official a
Lczo;a(Laqm;Lcud;Lcud;)I
-
onProjectileSpawned
public static void onProjectileSpawned(ServerWorld world, ItemStack weaponStack, PersistentProjectileEntity projectileEntity, Consumer<Item> onBreak) - Mappings:
Namespace Name Mixin selector named onProjectileSpawned
Lnet/minecraft/enchantment/EnchantmentHelper;onProjectileSpawned(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/projectile/PersistentProjectileEntity;Ljava/util/function/Consumer;)V
intermediary method_60127
Lnet/minecraft/class_1890;method_60127(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1665;Ljava/util/function/Consumer;)V
official a
Lczo;a(Laqm;Lcud;Lcmr;Ljava/util/function/Consumer;)V
-
onHitBlock
public static void onHitBlock(ServerWorld world, ItemStack stack, @Nullable @Nullable LivingEntity user, Entity enchantedEntity, @Nullable @Nullable EquipmentSlot slot, Vec3d pos, Consumer<Item> onBreak) - Mappings:
Namespace Name Mixin selector named onHitBlock
Lnet/minecraft/enchantment/EnchantmentHelper;onHitBlock(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/EquipmentSlot;Lnet/minecraft/util/math/Vec3d;Ljava/util/function/Consumer;)V
intermediary method_60124
Lnet/minecraft/class_1890;method_60124(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1309;Lnet/minecraft/class_1297;Lnet/minecraft/class_1304;Lnet/minecraft/class_243;Ljava/util/function/Consumer;)V
official a
Lczo;a(Laqm;Lcud;Lbtc;Lbsh;Lbso;Lewh;Ljava/util/function/Consumer;)V
-
getRepairWithXp
- Mappings:
Namespace Name Mixin selector named getRepairWithXp
Lnet/minecraft/enchantment/EnchantmentHelper;getRepairWithXp(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;I)I
intermediary method_60168
Lnet/minecraft/class_1890;method_60168(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;I)I
official c
Lczo;c(Laqm;Lcud;I)I
-
getEquipmentDropChance
public static float getEquipmentDropChance(ServerWorld world, LivingEntity attacker, DamageSource damageSource, float baseEquipmentDropChance) - Mappings:
Namespace Name Mixin selector named getEquipmentDropChance
Lnet/minecraft/enchantment/EnchantmentHelper;getEquipmentDropChance(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/damage/DamageSource;F)F
intermediary method_60113
Lnet/minecraft/class_1890;method_60113(Lnet/minecraft/class_3218;Lnet/minecraft/class_1309;Lnet/minecraft/class_1282;F)F
official a
Lczo;a(Laqm;Lbtc;Lbra;F)F
-
applyAttributeModifiers
public static void applyAttributeModifiers(ItemStack stack, AttributeModifierSlot slot, BiConsumer<RegistryEntry<EntityAttribute>, EntityAttributeModifier> attributeModifierConsumer) - Mappings:
Namespace Name Mixin selector named applyAttributeModifiers
Lnet/minecraft/enchantment/EnchantmentHelper;applyAttributeModifiers(Lnet/minecraft/item/ItemStack;Lnet/minecraft/component/type/AttributeModifierSlot;Ljava/util/function/BiConsumer;)V
intermediary method_60622
Lnet/minecraft/class_1890;method_60622(Lnet/minecraft/class_1799;Lnet/minecraft/class_9274;Ljava/util/function/BiConsumer;)V
official a
Lczo;a(Lcud;Lbsp;Ljava/util/function/BiConsumer;)V
-
applyAttributeModifiers
public static void applyAttributeModifiers(ItemStack stack, EquipmentSlot slot, BiConsumer<RegistryEntry<EntityAttribute>, EntityAttributeModifier> attributeModifierConsumer) - Mappings:
Namespace Name Mixin selector named applyAttributeModifiers
Lnet/minecraft/enchantment/EnchantmentHelper;applyAttributeModifiers(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/EquipmentSlot;Ljava/util/function/BiConsumer;)V
intermediary method_60140
Lnet/minecraft/class_1890;method_60140(Lnet/minecraft/class_1799;Lnet/minecraft/class_1304;Ljava/util/function/BiConsumer;)V
official a
Lczo;a(Lcud;Lbso;Ljava/util/function/BiConsumer;)V
-
getFishingLuckBonus
- Mappings:
Namespace Name Mixin selector named getFishingLuckBonus
Lnet/minecraft/enchantment/EnchantmentHelper;getFishingLuckBonus(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;)I
intermediary method_8223
Lnet/minecraft/class_1890;method_8223(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;)I
official a
Lczo;a(Laqm;Lcud;Lbsh;)I
-
getFishingTimeReduction
- Mappings:
Namespace Name Mixin selector named getFishingTimeReduction
Lnet/minecraft/enchantment/EnchantmentHelper;getFishingTimeReduction(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;)F
intermediary method_60158
Lnet/minecraft/class_1890;method_60158(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;)F
official b
Lczo;b(Laqm;Lcud;Lbsh;)F
-
getTridentReturnAcceleration
- Mappings:
Namespace Name Mixin selector named getTridentReturnAcceleration
Lnet/minecraft/enchantment/EnchantmentHelper;getTridentReturnAcceleration(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;)I
intermediary method_60169
Lnet/minecraft/class_1890;method_60169(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;)I
official c
Lczo;c(Laqm;Lcud;Lbsh;)I
-
getCrossbowChargeTime
- Mappings:
Namespace Name Mixin selector named getCrossbowChargeTime
Lnet/minecraft/enchantment/EnchantmentHelper;getCrossbowChargeTime(Lnet/minecraft/entity/LivingEntity;F)F
intermediary method_60159
Lnet/minecraft/class_1890;method_60159(Lnet/minecraft/class_1309;F)F
official a
Lczo;a(Lbtc;F)F
-
getTridentSpinAttackStrength
- Mappings:
Namespace Name Mixin selector named getTridentSpinAttackStrength
Lnet/minecraft/enchantment/EnchantmentHelper;getTridentSpinAttackStrength(Lnet/minecraft/entity/LivingEntity;)F
intermediary method_60123
Lnet/minecraft/class_1890;method_60123(Lnet/minecraft/class_1309;)F
official b
Lczo;b(Lbtc;)F
-
hasAnyEnchantmentsIn
- Mappings:
Namespace Name Mixin selector named hasAnyEnchantmentsIn
Lnet/minecraft/enchantment/EnchantmentHelper;hasAnyEnchantmentsIn(Lnet/minecraft/item/ItemStack;Lnet/minecraft/registry/tag/TagKey;)Z
intermediary method_60138
Lnet/minecraft/class_1890;method_60138(Lnet/minecraft/class_1799;Lnet/minecraft/class_6862;)Z
official a
Lczo;a(Lcud;Lawm;)Z
-
hasAnyEnchantmentsWith
- Mappings:
Namespace Name Mixin selector named hasAnyEnchantmentsWith
Lnet/minecraft/enchantment/EnchantmentHelper;hasAnyEnchantmentsWith(Lnet/minecraft/item/ItemStack;Lnet/minecraft/component/ComponentType;)Z
intermediary method_60142
Lnet/minecraft/class_1890;method_60142(Lnet/minecraft/class_1799;Lnet/minecraft/class_9331;)Z
official a
Lczo;a(Lcud;Lkm;)Z
-
getEffect
- Mappings:
Namespace Name Mixin selector named getEffect
Lnet/minecraft/enchantment/EnchantmentHelper;getEffect(Lnet/minecraft/item/ItemStack;Lnet/minecraft/component/ComponentType;)Ljava/util/Optional;
intermediary method_60165
Lnet/minecraft/class_1890;method_60165(Lnet/minecraft/class_1799;Lnet/minecraft/class_9331;)Ljava/util/Optional;
official b
Lczo;b(Lcud;Lkm;)Ljava/util/Optional;
-
getEffectListAndLevel
@Nullable public static <T> @Nullable com.mojang.datafixers.util.Pair<T,Integer> getEffectListAndLevel(ItemStack stack, ComponentType<T> componentType) - Mappings:
Namespace Name Mixin selector named getEffectListAndLevel
Lnet/minecraft/enchantment/EnchantmentHelper;getEffectListAndLevel(Lnet/minecraft/item/ItemStack;Lnet/minecraft/component/ComponentType;)Lcom/mojang/datafixers/util/Pair;
intermediary method_60174
Lnet/minecraft/class_1890;method_60174(Lnet/minecraft/class_1799;Lnet/minecraft/class_9331;)Lcom/mojang/datafixers/util/Pair;
official c
Lczo;c(Lcud;Lkm;)Lcom/mojang/datafixers/util/Pair;
-
chooseEquipmentWith
public static Optional<EnchantmentEffectContext> chooseEquipmentWith(ComponentType<?> componentType, LivingEntity entity, Predicate<ItemStack> stackPredicate) Returns a pair of an equipment slot and the item stack in the supplied entity's slot. It indicates the item stack has the enchantment supplied.If multiple equipment slots' item stacks are valid, a random pair is returned.
- Returns:
- a pair of an equipment slot and the item stack in the supplied entity's slot
- Mappings:
Namespace Name Mixin selector named chooseEquipmentWith
Lnet/minecraft/enchantment/EnchantmentHelper;chooseEquipmentWith(Lnet/minecraft/component/ComponentType;Lnet/minecraft/entity/LivingEntity;Ljava/util/function/Predicate;)Ljava/util/Optional;
intermediary method_8204
Lnet/minecraft/class_1890;method_8204(Lnet/minecraft/class_9331;Lnet/minecraft/class_1309;Ljava/util/function/Predicate;)Ljava/util/Optional;
official a
Lczo;a(Lkm;Lbtc;Ljava/util/function/Predicate;)Ljava/util/Optional;
-
calculateRequiredExperienceLevel
public static int calculateRequiredExperienceLevel(Random random, int slotIndex, int bookshelfCount, ItemStack stack) Returns the required experience level for an enchanting option in the enchanting table's screen, or the enchantment screen.- Parameters:
random
- the random, which guarantees consistent results with the same seedslotIndex
- the index of the enchanting optionbookshelfCount
- the number of bookshelvesstack
- the item stack to enchant- Returns:
- the required experience level for an enchanting option in the enchanting table's screen, or the enchantment screen
- Mappings:
Namespace Name Mixin selector named calculateRequiredExperienceLevel
Lnet/minecraft/enchantment/EnchantmentHelper;calculateRequiredExperienceLevel(Lnet/minecraft/util/math/random/Random;IILnet/minecraft/item/ItemStack;)I
intermediary method_8227
Lnet/minecraft/class_1890;method_8227(Lnet/minecraft/class_5819;IILnet/minecraft/class_1799;)I
official a
Lczo;a(Layo;IILcud;)I
-
enchant
public static ItemStack enchant(Random random, ItemStack stack, int level, DynamicRegistryManager dynamicRegistryManager, Optional<? extends RegistryEntryList<Enchantment>> enchantments) - Mappings:
Namespace Name Mixin selector named enchant
Lnet/minecraft/enchantment/EnchantmentHelper;enchant(Lnet/minecraft/util/math/random/Random;Lnet/minecraft/item/ItemStack;ILnet/minecraft/registry/DynamicRegistryManager;Ljava/util/Optional;)Lnet/minecraft/item/ItemStack;
intermediary method_60133
Lnet/minecraft/class_1890;method_60133(Lnet/minecraft/class_5819;Lnet/minecraft/class_1799;ILnet/minecraft/class_5455;Ljava/util/Optional;)Lnet/minecraft/class_1799;
official a
Lczo;a(Layo;Lcud;ILjx;Ljava/util/Optional;)Lcud;
-
enchant
public static ItemStack enchant(Random random, ItemStack stack, int level, Stream<RegistryEntry<Enchantment>> possibleEnchantments) Enchants thetarget
item stack and returns it.- Mappings:
Namespace Name Mixin selector named enchant
Lnet/minecraft/enchantment/EnchantmentHelper;enchant(Lnet/minecraft/util/math/random/Random;Lnet/minecraft/item/ItemStack;ILjava/util/stream/Stream;)Lnet/minecraft/item/ItemStack;
intermediary method_8233
Lnet/minecraft/class_1890;method_8233(Lnet/minecraft/class_5819;Lnet/minecraft/class_1799;ILjava/util/stream/Stream;)Lnet/minecraft/class_1799;
official a
Lczo;a(Layo;Lcud;ILjava/util/stream/Stream;)Lcud;
-
generateEnchantments
public static List<EnchantmentLevelEntry> generateEnchantments(Random random, ItemStack stack, int level, Stream<RegistryEntry<Enchantment>> possibleEnchantments) Generate the enchantments for enchanting thestack
.- Mappings:
Namespace Name Mixin selector named generateEnchantments
Lnet/minecraft/enchantment/EnchantmentHelper;generateEnchantments(Lnet/minecraft/util/math/random/Random;Lnet/minecraft/item/ItemStack;ILjava/util/stream/Stream;)Ljava/util/List;
intermediary method_8230
Lnet/minecraft/class_1890;method_8230(Lnet/minecraft/class_5819;Lnet/minecraft/class_1799;ILjava/util/stream/Stream;)Ljava/util/List;
official b
Lczo;b(Layo;Lcud;ILjava/util/stream/Stream;)Ljava/util/List;
-
removeConflicts
public static void removeConflicts(List<EnchantmentLevelEntry> possibleEntries, EnchantmentLevelEntry pickedEntry) Remove entries conflicting with the picked entry from the possible entries.- Parameters:
possibleEntries
- the possible entriespickedEntry
- the picked entry- Mappings:
Namespace Name Mixin selector named removeConflicts
Lnet/minecraft/enchantment/EnchantmentHelper;removeConflicts(Ljava/util/List;Lnet/minecraft/enchantment/EnchantmentLevelEntry;)V
intermediary method_8231
Lnet/minecraft/class_1890;method_8231(Ljava/util/List;Lnet/minecraft/class_1889;)V
official a
Lczo;a(Ljava/util/List;Lczp;)V
-
isCompatible
public static boolean isCompatible(Collection<RegistryEntry<Enchantment>> existing, RegistryEntry<Enchantment> candidate) Returns whether thecandidate
enchantment is compatible with theexisting
enchantments.- Returns:
- whether the
candidate
enchantment is compatible with theexisting
enchantments - Mappings:
Namespace Name Mixin selector named isCompatible
Lnet/minecraft/enchantment/EnchantmentHelper;isCompatible(Ljava/util/Collection;Lnet/minecraft/registry/entry/RegistryEntry;)Z
intermediary method_8201
Lnet/minecraft/class_1890;method_8201(Ljava/util/Collection;Lnet/minecraft/class_6880;)Z
official a
Lczo;a(Ljava/util/Collection;Ljj;)Z
-
getPossibleEntries
public static List<EnchantmentLevelEntry> getPossibleEntries(int level, ItemStack stack, Stream<RegistryEntry<Enchantment>> possibleEnchantments) Gets all the possible entries for enchanting thestack
at the givenpower
.- Mappings:
Namespace Name Mixin selector named getPossibleEntries
Lnet/minecraft/enchantment/EnchantmentHelper;getPossibleEntries(ILnet/minecraft/item/ItemStack;Ljava/util/stream/Stream;)Ljava/util/List;
intermediary method_8229
Lnet/minecraft/class_1890;method_8229(ILnet/minecraft/class_1799;Ljava/util/stream/Stream;)Ljava/util/List;
official a
Lczo;a(ILcud;Ljava/util/stream/Stream;)Ljava/util/List;
-
applyEnchantmentProvider
public static void applyEnchantmentProvider(ItemStack stack, DynamicRegistryManager registryManager, RegistryKey<EnchantmentProvider> providerKey, LocalDifficulty localDifficulty, Random random) - Mappings:
Namespace Name Mixin selector named applyEnchantmentProvider
Lnet/minecraft/enchantment/EnchantmentHelper;applyEnchantmentProvider(Lnet/minecraft/item/ItemStack;Lnet/minecraft/registry/DynamicRegistryManager;Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/world/LocalDifficulty;Lnet/minecraft/util/math/random/Random;)V
intermediary method_60137
Lnet/minecraft/class_1890;method_60137(Lnet/minecraft/class_1799;Lnet/minecraft/class_5455;Lnet/minecraft/class_5321;Lnet/minecraft/class_1266;Lnet/minecraft/class_5819;)V
official a
Lczo;a(Lcud;Ljx;Lakj;Lbqf;Layo;)V
-