Package net.minecraft.enchantment
Class EnchantmentHelper
java.lang.Object
net.minecraft.enchantment.EnchantmentHelper
- Mappings:
Namespace Name named net/minecraft/enchantment/EnchantmentHelperintermediary net/minecraft/class_1890official dhl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interfaceprivate static interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ItemEnchantmentsComponentapply(ItemStack stack, Consumer<ItemEnchantmentsComponent.Builder> applier) static voidapplyAttributeModifiers(ItemStack stack, AttributeModifierSlot slot, BiConsumer<RegistryEntry<EntityAttribute>, EntityAttributeModifier> attributeModifierConsumer) static voidapplyAttributeModifiers(ItemStack stack, EquipmentSlot slot, BiConsumer<RegistryEntry<EntityAttribute>, EntityAttributeModifier> attributeModifierConsumer) static voidapplyEnchantmentProvider(ItemStack stack, DynamicRegistryManager registryManager, RegistryKey<EnchantmentProvider> providerKey, LocalDifficulty localDifficulty, Random random) static voidapplyLocationBasedEffects(ServerWorld world, LivingEntity user) static voidapplyLocationBasedEffects(ServerWorld world, ItemStack stack, LivingEntity user, EquipmentSlot slot) static intcalculateRequiredExperienceLevel(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 booleancanHaveEnchantments(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 ItemStackenchant(Random random, ItemStack stack, int level, Stream<RegistryEntry<Enchantment>> possibleEnchantments) Enchants thetargetitem stack and returns it.static ItemStackenchant(Random random, ItemStack stack, int level, DynamicRegistryManager dynamicRegistryManager, Optional<? extends RegistryEntryList<Enchantment>> enchantments) private static voidforEachEnchantment(LivingEntity entity, EnchantmentHelper.ContextAwareConsumer contextAwareConsumer) private static voidforEachEnchantment(ItemStack stack, EnchantmentHelper.Consumer consumer) private static voidforEachEnchantment(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 intgetAmmoUse(ServerWorld world, ItemStack rangedWeaponStack, ItemStack projectileStack, int baseAmmoUse) static floatgetArmorEffectiveness(ServerWorld world, ItemStack stack, Entity user, DamageSource damageSource, float baseArmorEffectiveness) static intgetBlockExperience(ServerWorld world, ItemStack stack, int baseBlockExperience) static floatgetCrossbowChargeTime(ItemStack stack, LivingEntity user, float baseCrossbowChargeTime) static floatgetDamage(ServerWorld world, ItemStack stack, Entity target, DamageSource damageSource, float baseDamage) static <T> Optional<T> getEffect(ItemStack stack, ComponentType<List<T>> componentType) static ItemStackstatic ItemEnchantmentsComponentgetEnchantments(ItemStack stack) private static ComponentType<ItemEnchantmentsComponent> static floatgetEquipmentDropChance(ServerWorld world, LivingEntity attacker, DamageSource damageSource, float baseEquipmentDropChance) static intgetEquipmentLevel(RegistryEntry<Enchantment> enchantment, LivingEntity entity) Returns the highest level of the passed enchantment in the enchantment's applicable equipment slots' item stacks.static intgetFishingLuckBonus(ServerWorld world, ItemStack stack, Entity user) static floatgetFishingTimeReduction(ServerWorld world, ItemStack stack, Entity user) getHighestLevelEffect(ItemStack stack, ComponentType<T> componentType) static intgetItemDamage(ServerWorld world, ItemStack stack, int baseItemDamage) static intgetLevel(RegistryEntry<Enchantment> enchantment, ItemStack stack) Gets the level of an enchantment on an item stack.static intgetMobExperience(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 thestackat the givenpower.static intgetProjectileCount(ServerWorld world, ItemStack stack, Entity user, int baseProjectileCount) static intgetProjectilePiercing(ServerWorld world, ItemStack weaponStack, ItemStack projectileStack) static floatgetProjectileSpread(ServerWorld world, ItemStack stack, Entity user, float baseProjectileSpread) static floatgetProtectionAmount(ServerWorld world, LivingEntity user, DamageSource damageSource) static intgetRepairWithExperience(ServerWorld world, ItemStack stack, int baseRepairWithExperience) static floatgetSmashDamagePerFallenBlock(ServerWorld world, ItemStack stack, Entity target, DamageSource damageSource, float baseSmashDamagePerFallenBlock) static intgetTridentReturnAcceleration(ServerWorld world, ItemStack stack, Entity user) static floatgetTridentSpinAttackStrength(ItemStack stack, LivingEntity user) static booleanhasAnyEnchantmentsIn(ItemStack stack, TagKey<Enchantment> tag) static booleanhasAnyEnchantmentsWith(ItemStack stack, ComponentType<?> componentType) static booleanhasEnchantments(ItemStack stack) static booleanisCompatible(Collection<RegistryEntry<Enchantment>> existing, RegistryEntry<Enchantment> candidate) Returns whether thecandidateenchantment is compatible with theexistingenchantments.static booleanisInvulnerableTo(ServerWorld world, LivingEntity user, DamageSource damageSource) static floatmodifyKnockback(ServerWorld world, ItemStack stack, Entity target, DamageSource damageSource, float baseKnockback) static voidonHitBlock(ServerWorld world, ItemStack stack, @Nullable LivingEntity user, Entity enchantedEntity, @Nullable EquipmentSlot slot, Vec3d pos, BlockState state, Consumer<Item> onBreak) static voidonProjectileSpawned(ServerWorld world, ItemStack weaponStack, ProjectileEntity projectile, Consumer<Item> onBreak) static voidonTargetDamaged(ServerWorld world, Entity target, DamageSource damageSource) static voidonTargetDamaged(ServerWorld world, Entity target, DamageSource damageSource, @Nullable ItemStack weapon) static voidonTargetDamaged(ServerWorld world, Entity target, DamageSource damageSource, @Nullable ItemStack weapon, Consumer<Item> breakCallback) static voidonTick(ServerWorld world, LivingEntity user) static voidremoveConflicts(List<EnchantmentLevelEntry> possibleEntries, EnchantmentLevelEntry pickedEntry) Remove entries conflicting with the picked entry from the possible entries.static voidstatic voidremoveLocationBasedEffects(ItemStack stack, LivingEntity user, EquipmentSlot slot) static voidset(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 getLevelLnet/minecraft/enchantment/EnchantmentHelper;getLevel(Lnet/minecraft/registry/entry/RegistryEntry;Lnet/minecraft/item/ItemStack;)Iintermediary method_8225Lnet/minecraft/class_1890;method_8225(Lnet/minecraft/class_6880;Lnet/minecraft/class_1799;)Iofficial aLdhl;a(Lji;Ldaw;)I
-
apply
public static ItemEnchantmentsComponent apply(ItemStack stack, Consumer<ItemEnchantmentsComponent.Builder> applier) - Mappings:
Namespace Name Mixin selector named applyLnet/minecraft/enchantment/EnchantmentHelper;apply(Lnet/minecraft/item/ItemStack;Ljava/util/function/Consumer;)Lnet/minecraft/component/type/ItemEnchantmentsComponent;intermediary method_57531Lnet/minecraft/class_1890;method_57531(Lnet/minecraft/class_1799;Ljava/util/function/Consumer;)Lnet/minecraft/class_9304;official aLdhl;a(Ldaw;Ljava/util/function/Consumer;)Ldhp;
-
canHaveEnchantments
- Mappings:
Namespace Name Mixin selector named canHaveEnchantmentsLnet/minecraft/enchantment/EnchantmentHelper;canHaveEnchantments(Lnet/minecraft/item/ItemStack;)Zintermediary method_57529Lnet/minecraft/class_1890;method_57529(Lnet/minecraft/class_1799;)Zofficial aLdhl;a(Ldaw;)Z
-
set
- Mappings:
Namespace Name Mixin selector named setLnet/minecraft/enchantment/EnchantmentHelper;set(Lnet/minecraft/item/ItemStack;Lnet/minecraft/component/type/ItemEnchantmentsComponent;)Vintermediary method_57530Lnet/minecraft/class_1890;method_57530(Lnet/minecraft/class_1799;Lnet/minecraft/class_9304;)Vofficial aLdhl;a(Ldaw;Ldhp;)V
-
getEnchantments
- Mappings:
Namespace Name Mixin selector named getEnchantmentsLnet/minecraft/enchantment/EnchantmentHelper;getEnchantments(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/component/type/ItemEnchantmentsComponent;intermediary method_57532Lnet/minecraft/class_1890;method_57532(Lnet/minecraft/class_1799;)Lnet/minecraft/class_9304;official bLdhl;b(Ldaw;)Ldhp;
-
getEnchantmentsComponentType
private static ComponentType<ItemEnchantmentsComponent> getEnchantmentsComponentType(ItemStack stack) - Mappings:
Namespace Name Mixin selector named getEnchantmentsComponentTypeLnet/minecraft/enchantment/EnchantmentHelper;getEnchantmentsComponentType(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/component/ComponentType;intermediary method_57533Lnet/minecraft/class_1890;method_57533(Lnet/minecraft/class_1799;)Lnet/minecraft/class_9331;official dLdhl;d(Ldaw;)Lkm;
-
hasEnchantments
- Mappings:
Namespace Name Mixin selector named hasEnchantmentsLnet/minecraft/enchantment/EnchantmentHelper;hasEnchantments(Lnet/minecraft/item/ItemStack;)Zintermediary method_58117Lnet/minecraft/class_1890;method_58117(Lnet/minecraft/class_1799;)Zofficial cLdhl;c(Ldaw;)Z
-
getItemDamage
- Mappings:
Namespace Name Mixin selector named getItemDamageLnet/minecraft/enchantment/EnchantmentHelper;getItemDamage(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;I)Iintermediary method_60117Lnet/minecraft/class_1890;method_60117(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;I)Iofficial aLdhl;a(Lasg;Ldaw;I)I
-
getAmmoUse
public static int getAmmoUse(ServerWorld world, ItemStack rangedWeaponStack, ItemStack projectileStack, int baseAmmoUse) - Mappings:
Namespace Name Mixin selector named getAmmoUseLnet/minecraft/enchantment/EnchantmentHelper;getAmmoUse(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;I)Iintermediary method_60129Lnet/minecraft/class_1890;method_60129(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;I)Iofficial aLdhl;a(Lasg;Ldaw;Ldaw;I)I
-
getBlockExperience
- Mappings:
Namespace Name Mixin selector named getBlockExperienceLnet/minecraft/enchantment/EnchantmentHelper;getBlockExperience(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;I)Iintermediary method_60157Lnet/minecraft/class_1890;method_60157(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;I)Iofficial bLdhl;b(Lasg;Ldaw;I)I
-
getMobExperience
public static int getMobExperience(ServerWorld world, @Nullable @Nullable Entity attacker, Entity mob, int baseMobExperience) - Mappings:
Namespace Name Mixin selector named getMobExperienceLnet/minecraft/enchantment/EnchantmentHelper;getMobExperience(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/Entity;I)Iintermediary method_60109Lnet/minecraft/class_1890;method_60109(Lnet/minecraft/class_3218;Lnet/minecraft/class_1297;Lnet/minecraft/class_1297;I)Iofficial aLdhl;a(Lasg;Lbxn;Lbxn;I)I
-
getEnchantedBookWith
- Mappings:
Namespace Name Mixin selector named getEnchantedBookWithLnet/minecraft/enchantment/EnchantmentHelper;getEnchantedBookWith(Lnet/minecraft/enchantment/EnchantmentLevelEntry;)Lnet/minecraft/item/ItemStack;intermediary method_61711Lnet/minecraft/class_1890;method_61711(Lnet/minecraft/class_1889;)Lnet/minecraft/class_1799;official aLdhl;a(Ldhm;)Ldaw;
-
forEachEnchantment
- Mappings:
Namespace Name Mixin selector named forEachEnchantmentLnet/minecraft/enchantment/EnchantmentHelper;forEachEnchantment(Lnet/minecraft/item/ItemStack;Lnet/minecraft/enchantment/EnchantmentHelper$Consumer;)Vintermediary method_8220Lnet/minecraft/class_1890;method_8220(Lnet/minecraft/class_1799;Lnet/minecraft/class_1890$class_1891;)Vofficial aLdhl;a(Ldaw;Ldhl$b;)V
-
forEachEnchantment
private static void forEachEnchantment(ItemStack stack, EquipmentSlot slot, LivingEntity entity, EnchantmentHelper.ContextAwareConsumer contextAwareConsumer) - Mappings:
Namespace Name Mixin selector named forEachEnchantmentLnet/minecraft/enchantment/EnchantmentHelper;forEachEnchantment(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/EquipmentSlot;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/enchantment/EnchantmentHelper$ContextAwareConsumer;)Vintermediary method_60139Lnet/minecraft/class_1890;method_60139(Lnet/minecraft/class_1799;Lnet/minecraft/class_1304;Lnet/minecraft/class_1309;Lnet/minecraft/class_1890$class_9702;)Vofficial aLdhl;a(Ldaw;Lbxx;Lbyn;Ldhl$a;)V
-
forEachEnchantment
private static void forEachEnchantment(LivingEntity entity, EnchantmentHelper.ContextAwareConsumer contextAwareConsumer) - Mappings:
Namespace Name Mixin selector named forEachEnchantmentLnet/minecraft/enchantment/EnchantmentHelper;forEachEnchantment(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/enchantment/EnchantmentHelper$ContextAwareConsumer;)Vintermediary method_8209Lnet/minecraft/class_1890;method_8209(Lnet/minecraft/class_1309;Lnet/minecraft/class_1890$class_9702;)Vofficial aLdhl;a(Lbyn;Ldhl$a;)V
-
isInvulnerableTo
public static boolean isInvulnerableTo(ServerWorld world, LivingEntity user, DamageSource damageSource) - Mappings:
Namespace Name Mixin selector named isInvulnerableToLnet/minecraft/enchantment/EnchantmentHelper;isInvulnerableTo(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/damage/DamageSource;)Zintermediary method_60112Lnet/minecraft/class_1890;method_60112(Lnet/minecraft/class_3218;Lnet/minecraft/class_1309;Lnet/minecraft/class_1282;)Zofficial aLdhl;a(Lasg;Lbyn;Lbwc;)Z
-
getProtectionAmount
public static float getProtectionAmount(ServerWorld world, LivingEntity user, DamageSource damageSource) - Mappings:
Namespace Name Mixin selector named getProtectionAmountLnet/minecraft/enchantment/EnchantmentHelper;getProtectionAmount(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/damage/DamageSource;)Fintermediary method_8219Lnet/minecraft/class_1890;method_8219(Lnet/minecraft/class_3218;Lnet/minecraft/class_1309;Lnet/minecraft/class_1282;)Fofficial bLdhl;b(Lasg;Lbyn;Lbwc;)F
-
getDamage
public static float getDamage(ServerWorld world, ItemStack stack, Entity target, DamageSource damageSource, float baseDamage) - Mappings:
Namespace Name Mixin selector named getDamageLnet/minecraft/enchantment/EnchantmentHelper;getDamage(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/damage/DamageSource;F)Fintermediary method_60120Lnet/minecraft/class_1890;method_60120(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;Lnet/minecraft/class_1282;F)Fofficial aLdhl;a(Lasg;Ldaw;Lbxn;Lbwc;F)F
-
getSmashDamagePerFallenBlock
public static float getSmashDamagePerFallenBlock(ServerWorld world, ItemStack stack, Entity target, DamageSource damageSource, float baseSmashDamagePerFallenBlock) - Mappings:
Namespace Name Mixin selector named getSmashDamagePerFallenBlockLnet/minecraft/enchantment/EnchantmentHelper;getSmashDamagePerFallenBlock(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/damage/DamageSource;F)Fintermediary method_60160Lnet/minecraft/class_1890;method_60160(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;Lnet/minecraft/class_1282;F)Fofficial bLdhl;b(Lasg;Ldaw;Lbxn;Lbwc;F)F
-
getArmorEffectiveness
public static float getArmorEffectiveness(ServerWorld world, ItemStack stack, Entity user, DamageSource damageSource, float baseArmorEffectiveness) - Mappings:
Namespace Name Mixin selector named getArmorEffectivenessLnet/minecraft/enchantment/EnchantmentHelper;getArmorEffectiveness(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/damage/DamageSource;F)Fintermediary method_60170Lnet/minecraft/class_1890;method_60170(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;Lnet/minecraft/class_1282;F)Fofficial cLdhl;c(Lasg;Ldaw;Lbxn;Lbwc;F)F
-
modifyKnockback
public static float modifyKnockback(ServerWorld world, ItemStack stack, Entity target, DamageSource damageSource, float baseKnockback) - Mappings:
Namespace Name Mixin selector named modifyKnockbackLnet/minecraft/enchantment/EnchantmentHelper;modifyKnockback(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/damage/DamageSource;F)Fintermediary method_60175Lnet/minecraft/class_1890;method_60175(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;Lnet/minecraft/class_1282;F)Fofficial dLdhl;d(Lasg;Ldaw;Lbxn;Lbwc;F)F
-
onTargetDamaged
- Mappings:
Namespace Name Mixin selector named onTargetDamagedLnet/minecraft/enchantment/EnchantmentHelper;onTargetDamaged(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/damage/DamageSource;)Vintermediary method_60107Lnet/minecraft/class_1890;method_60107(Lnet/minecraft/class_3218;Lnet/minecraft/class_1297;Lnet/minecraft/class_1282;)Vofficial aLdhl;a(Lasg;Lbxn;Lbwc;)V
-
onTargetDamaged
public static void onTargetDamaged(ServerWorld world, Entity target, DamageSource damageSource, @Nullable @Nullable ItemStack weapon) - Mappings:
Namespace Name Mixin selector named onTargetDamagedLnet/minecraft/enchantment/EnchantmentHelper;onTargetDamaged(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/damage/DamageSource;Lnet/minecraft/item/ItemStack;)Vintermediary method_60619Lnet/minecraft/class_1890;method_60619(Lnet/minecraft/class_3218;Lnet/minecraft/class_1297;Lnet/minecraft/class_1282;Lnet/minecraft/class_1799;)Vofficial aLdhl;a(Lasg;Lbxn;Lbwc;Ldaw;)V
-
onTargetDamaged
public static void onTargetDamaged(ServerWorld world, Entity target, DamageSource damageSource, @Nullable @Nullable ItemStack weapon, @Nullable Consumer<Item> breakCallback) - Mappings:
Namespace Name Mixin selector named onTargetDamagedLnet/minecraft/enchantment/EnchantmentHelper;onTargetDamaged(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/damage/DamageSource;Lnet/minecraft/item/ItemStack;Ljava/util/function/Consumer;)Vintermediary method_63016Lnet/minecraft/class_1890;method_63016(Lnet/minecraft/class_3218;Lnet/minecraft/class_1297;Lnet/minecraft/class_1282;Lnet/minecraft/class_1799;Ljava/util/function/Consumer;)Vofficial aLdhl;a(Lasg;Lbxn;Lbwc;Ldaw;Ljava/util/function/Consumer;)V
-
applyLocationBasedEffects
- Mappings:
Namespace Name Mixin selector named applyLocationBasedEffectsLnet/minecraft/enchantment/EnchantmentHelper;applyLocationBasedEffects(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/LivingEntity;)Vintermediary method_60111Lnet/minecraft/class_1890;method_60111(Lnet/minecraft/class_3218;Lnet/minecraft/class_1309;)Vofficial aLdhl;a(Lasg;Lbyn;)V
-
applyLocationBasedEffects
public static void applyLocationBasedEffects(ServerWorld world, ItemStack stack, LivingEntity user, EquipmentSlot slot) - Mappings:
Namespace Name Mixin selector named applyLocationBasedEffectsLnet/minecraft/enchantment/EnchantmentHelper;applyLocationBasedEffects(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/EquipmentSlot;)Vintermediary method_60125Lnet/minecraft/class_1890;method_60125(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;)Vofficial aLdhl;a(Lasg;Ldaw;Lbyn;Lbxx;)V
-
removeLocationBasedEffects
- Mappings:
Namespace Name Mixin selector named removeLocationBasedEffectsLnet/minecraft/enchantment/EnchantmentHelper;removeLocationBasedEffects(Lnet/minecraft/entity/LivingEntity;)Vintermediary method_60135Lnet/minecraft/class_1890;method_60135(Lnet/minecraft/class_1309;)Vofficial aLdhl;a(Lbyn;)V
-
removeLocationBasedEffects
public static void removeLocationBasedEffects(ItemStack stack, LivingEntity user, EquipmentSlot slot) - Mappings:
Namespace Name Mixin selector named removeLocationBasedEffectsLnet/minecraft/enchantment/EnchantmentHelper;removeLocationBasedEffects(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/EquipmentSlot;)Vintermediary method_60141Lnet/minecraft/class_1890;method_60141(Lnet/minecraft/class_1799;Lnet/minecraft/class_1309;Lnet/minecraft/class_1304;)Vofficial aLdhl;a(Ldaw;Lbyn;Lbxx;)V
-
onTick
- Mappings:
Namespace Name Mixin selector named onTickLnet/minecraft/enchantment/EnchantmentHelper;onTick(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/LivingEntity;)Vintermediary method_60154Lnet/minecraft/class_1890;method_60154(Lnet/minecraft/class_3218;Lnet/minecraft/class_1309;)Vofficial bLdhl;b(Lasg;Lbyn;)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 getEquipmentLevelLnet/minecraft/enchantment/EnchantmentHelper;getEquipmentLevel(Lnet/minecraft/registry/entry/RegistryEntry;Lnet/minecraft/entity/LivingEntity;)Iintermediary method_8203Lnet/minecraft/class_1890;method_8203(Lnet/minecraft/class_6880;Lnet/minecraft/class_1309;)Iofficial aLdhl;a(Lji;Lbyn;)I
-
getProjectileCount
public static int getProjectileCount(ServerWorld world, ItemStack stack, Entity user, int baseProjectileCount) - Mappings:
Namespace Name Mixin selector named getProjectileCountLnet/minecraft/enchantment/EnchantmentHelper;getProjectileCount(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;I)Iintermediary method_60119Lnet/minecraft/class_1890;method_60119(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;I)Iofficial aLdhl;a(Lasg;Ldaw;Lbxn;I)I
-
getProjectileSpread
public static float getProjectileSpread(ServerWorld world, ItemStack stack, Entity user, float baseProjectileSpread) - Mappings:
Namespace Name Mixin selector named getProjectileSpreadLnet/minecraft/enchantment/EnchantmentHelper;getProjectileSpread(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;F)Fintermediary method_60118Lnet/minecraft/class_1890;method_60118(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;F)Fofficial aLdhl;a(Lasg;Ldaw;Lbxn;F)F
-
getProjectilePiercing
public static int getProjectilePiercing(ServerWorld world, ItemStack weaponStack, ItemStack projectileStack) - Mappings:
Namespace Name Mixin selector named getProjectilePiercingLnet/minecraft/enchantment/EnchantmentHelper;getProjectilePiercing(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Iintermediary method_60128Lnet/minecraft/class_1890;method_60128(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)Iofficial aLdhl;a(Lasg;Ldaw;Ldaw;)I
-
onProjectileSpawned
public static void onProjectileSpawned(ServerWorld world, ItemStack weaponStack, ProjectileEntity projectile, Consumer<Item> onBreak) - Mappings:
Namespace Name Mixin selector named onProjectileSpawnedLnet/minecraft/enchantment/EnchantmentHelper;onProjectileSpawned(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/projectile/ProjectileEntity;Ljava/util/function/Consumer;)Vintermediary method_60127Lnet/minecraft/class_1890;method_60127(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1676;Ljava/util/function/Consumer;)Vofficial aLdhl;a(Lasg;Ldaw;Lctp;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, BlockState state, Consumer<Item> onBreak) - Mappings:
Namespace Name Mixin selector named onHitBlockLnet/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;Lnet/minecraft/block/BlockState;Ljava/util/function/Consumer;)Vintermediary method_60124Lnet/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;Lnet/minecraft/class_2680;Ljava/util/function/Consumer;)Vofficial aLdhl;a(Lasg;Ldaw;Lbyn;Lbxn;Lbxx;Lfgo;Lecc;Ljava/util/function/Consumer;)V
-
getRepairWithExperience
public static int getRepairWithExperience(ServerWorld world, ItemStack stack, int baseRepairWithExperience) - Mappings:
Namespace Name Mixin selector named getRepairWithExperienceLnet/minecraft/enchantment/EnchantmentHelper;getRepairWithExperience(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;I)Iintermediary method_60168Lnet/minecraft/class_1890;method_60168(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;I)Iofficial cLdhl;c(Lasg;Ldaw;I)I
-
getEquipmentDropChance
public static float getEquipmentDropChance(ServerWorld world, LivingEntity attacker, DamageSource damageSource, float baseEquipmentDropChance) - Mappings:
Namespace Name Mixin selector named getEquipmentDropChanceLnet/minecraft/enchantment/EnchantmentHelper;getEquipmentDropChance(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/damage/DamageSource;F)Fintermediary method_60113Lnet/minecraft/class_1890;method_60113(Lnet/minecraft/class_3218;Lnet/minecraft/class_1309;Lnet/minecraft/class_1282;F)Fofficial aLdhl;a(Lasg;Lbyn;Lbwc;F)F
-
applyAttributeModifiers
public static void applyAttributeModifiers(ItemStack stack, AttributeModifierSlot slot, BiConsumer<RegistryEntry<EntityAttribute>, EntityAttributeModifier> attributeModifierConsumer) - Mappings:
Namespace Name Mixin selector named applyAttributeModifiersLnet/minecraft/enchantment/EnchantmentHelper;applyAttributeModifiers(Lnet/minecraft/item/ItemStack;Lnet/minecraft/component/type/AttributeModifierSlot;Ljava/util/function/BiConsumer;)Vintermediary method_60622Lnet/minecraft/class_1890;method_60622(Lnet/minecraft/class_1799;Lnet/minecraft/class_9274;Ljava/util/function/BiConsumer;)Vofficial aLdhl;a(Ldaw;Lbxy;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 applyAttributeModifiersLnet/minecraft/enchantment/EnchantmentHelper;applyAttributeModifiers(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/EquipmentSlot;Ljava/util/function/BiConsumer;)Vintermediary method_60140Lnet/minecraft/class_1890;method_60140(Lnet/minecraft/class_1799;Lnet/minecraft/class_1304;Ljava/util/function/BiConsumer;)Vofficial aLdhl;a(Ldaw;Lbxx;Ljava/util/function/BiConsumer;)V
-
getFishingLuckBonus
- Mappings:
Namespace Name Mixin selector named getFishingLuckBonusLnet/minecraft/enchantment/EnchantmentHelper;getFishingLuckBonus(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;)Iintermediary method_8223Lnet/minecraft/class_1890;method_8223(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;)Iofficial aLdhl;a(Lasg;Ldaw;Lbxn;)I
-
getFishingTimeReduction
- Mappings:
Namespace Name Mixin selector named getFishingTimeReductionLnet/minecraft/enchantment/EnchantmentHelper;getFishingTimeReduction(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;)Fintermediary method_60158Lnet/minecraft/class_1890;method_60158(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;)Fofficial bLdhl;b(Lasg;Ldaw;Lbxn;)F
-
getTridentReturnAcceleration
- Mappings:
Namespace Name Mixin selector named getTridentReturnAccelerationLnet/minecraft/enchantment/EnchantmentHelper;getTridentReturnAcceleration(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/Entity;)Iintermediary method_60169Lnet/minecraft/class_1890;method_60169(Lnet/minecraft/class_3218;Lnet/minecraft/class_1799;Lnet/minecraft/class_1297;)Iofficial cLdhl;c(Lasg;Ldaw;Lbxn;)I
-
getCrossbowChargeTime
public static float getCrossbowChargeTime(ItemStack stack, LivingEntity user, float baseCrossbowChargeTime) - Mappings:
Namespace Name Mixin selector named getCrossbowChargeTimeLnet/minecraft/enchantment/EnchantmentHelper;getCrossbowChargeTime(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;F)Fintermediary method_60159Lnet/minecraft/class_1890;method_60159(Lnet/minecraft/class_1799;Lnet/minecraft/class_1309;F)Fofficial aLdhl;a(Ldaw;Lbyn;F)F
-
getTridentSpinAttackStrength
- Mappings:
Namespace Name Mixin selector named getTridentSpinAttackStrengthLnet/minecraft/enchantment/EnchantmentHelper;getTridentSpinAttackStrength(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;)Fintermediary method_60123Lnet/minecraft/class_1890;method_60123(Lnet/minecraft/class_1799;Lnet/minecraft/class_1309;)Fofficial aLdhl;a(Ldaw;Lbyn;)F
-
hasAnyEnchantmentsIn
- Mappings:
Namespace Name Mixin selector named hasAnyEnchantmentsInLnet/minecraft/enchantment/EnchantmentHelper;hasAnyEnchantmentsIn(Lnet/minecraft/item/ItemStack;Lnet/minecraft/registry/tag/TagKey;)Zintermediary method_60138Lnet/minecraft/class_1890;method_60138(Lnet/minecraft/class_1799;Lnet/minecraft/class_6862;)Zofficial aLdhl;a(Ldaw;Layi;)Z
-
hasAnyEnchantmentsWith
- Mappings:
Namespace Name Mixin selector named hasAnyEnchantmentsWithLnet/minecraft/enchantment/EnchantmentHelper;hasAnyEnchantmentsWith(Lnet/minecraft/item/ItemStack;Lnet/minecraft/component/ComponentType;)Zintermediary method_60142Lnet/minecraft/class_1890;method_60142(Lnet/minecraft/class_1799;Lnet/minecraft/class_9331;)Zofficial aLdhl;a(Ldaw;Lkm;)Z
-
getEffect
- Mappings:
Namespace Name Mixin selector named getEffectLnet/minecraft/enchantment/EnchantmentHelper;getEffect(Lnet/minecraft/item/ItemStack;Lnet/minecraft/component/ComponentType;)Ljava/util/Optional;intermediary method_60165Lnet/minecraft/class_1890;method_60165(Lnet/minecraft/class_1799;Lnet/minecraft/class_9331;)Ljava/util/Optional;official bLdhl;b(Ldaw;Lkm;)Ljava/util/Optional;
-
getHighestLevelEffect
@Nullable public static <T> @Nullable com.mojang.datafixers.util.Pair<T,Integer> getHighestLevelEffect(ItemStack stack, ComponentType<T> componentType) - Mappings:
Namespace Name Mixin selector named getHighestLevelEffectLnet/minecraft/enchantment/EnchantmentHelper;getHighestLevelEffect(Lnet/minecraft/item/ItemStack;Lnet/minecraft/component/ComponentType;)Lcom/mojang/datafixers/util/Pair;intermediary method_60174Lnet/minecraft/class_1890;method_60174(Lnet/minecraft/class_1799;Lnet/minecraft/class_9331;)Lcom/mojang/datafixers/util/Pair;official cLdhl;c(Ldaw;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 chooseEquipmentWithLnet/minecraft/enchantment/EnchantmentHelper;chooseEquipmentWith(Lnet/minecraft/component/ComponentType;Lnet/minecraft/entity/LivingEntity;Ljava/util/function/Predicate;)Ljava/util/Optional;intermediary method_8204Lnet/minecraft/class_1890;method_8204(Lnet/minecraft/class_9331;Lnet/minecraft/class_1309;Ljava/util/function/Predicate;)Ljava/util/Optional;official aLdhl;a(Lkm;Lbyn;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 calculateRequiredExperienceLevelLnet/minecraft/enchantment/EnchantmentHelper;calculateRequiredExperienceLevel(Lnet/minecraft/util/math/random/Random;IILnet/minecraft/item/ItemStack;)Iintermediary method_8227Lnet/minecraft/class_1890;method_8227(Lnet/minecraft/class_5819;IILnet/minecraft/class_1799;)Iofficial aLdhl;a(Lbao;IILdaw;)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 enchantLnet/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_60133Lnet/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 aLdhl;a(Lbao;Ldaw;ILjw;Ljava/util/Optional;)Ldaw;
-
enchant
public static ItemStack enchant(Random random, ItemStack stack, int level, Stream<RegistryEntry<Enchantment>> possibleEnchantments) Enchants thetargetitem stack and returns it.- Mappings:
Namespace Name Mixin selector named enchantLnet/minecraft/enchantment/EnchantmentHelper;enchant(Lnet/minecraft/util/math/random/Random;Lnet/minecraft/item/ItemStack;ILjava/util/stream/Stream;)Lnet/minecraft/item/ItemStack;intermediary method_8233Lnet/minecraft/class_1890;method_8233(Lnet/minecraft/class_5819;Lnet/minecraft/class_1799;ILjava/util/stream/Stream;)Lnet/minecraft/class_1799;official aLdhl;a(Lbao;Ldaw;ILjava/util/stream/Stream;)Ldaw;
-
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 generateEnchantmentsLnet/minecraft/enchantment/EnchantmentHelper;generateEnchantments(Lnet/minecraft/util/math/random/Random;Lnet/minecraft/item/ItemStack;ILjava/util/stream/Stream;)Ljava/util/List;intermediary method_8230Lnet/minecraft/class_1890;method_8230(Lnet/minecraft/class_5819;Lnet/minecraft/class_1799;ILjava/util/stream/Stream;)Ljava/util/List;official bLdhl;b(Lbao;Ldaw;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 removeConflictsLnet/minecraft/enchantment/EnchantmentHelper;removeConflicts(Ljava/util/List;Lnet/minecraft/enchantment/EnchantmentLevelEntry;)Vintermediary method_8231Lnet/minecraft/class_1890;method_8231(Ljava/util/List;Lnet/minecraft/class_1889;)Vofficial aLdhl;a(Ljava/util/List;Ldhm;)V
-
isCompatible
public static boolean isCompatible(Collection<RegistryEntry<Enchantment>> existing, RegistryEntry<Enchantment> candidate) Returns whether thecandidateenchantment is compatible with theexistingenchantments.- Returns:
- whether the
candidateenchantment is compatible with theexistingenchantments - Mappings:
Namespace Name Mixin selector named isCompatibleLnet/minecraft/enchantment/EnchantmentHelper;isCompatible(Ljava/util/Collection;Lnet/minecraft/registry/entry/RegistryEntry;)Zintermediary method_8201Lnet/minecraft/class_1890;method_8201(Ljava/util/Collection;Lnet/minecraft/class_6880;)Zofficial aLdhl;a(Ljava/util/Collection;Lji;)Z
-
getPossibleEntries
public static List<EnchantmentLevelEntry> getPossibleEntries(int level, ItemStack stack, Stream<RegistryEntry<Enchantment>> possibleEnchantments) Gets all the possible entries for enchanting thestackat the givenpower.- Mappings:
Namespace Name Mixin selector named getPossibleEntriesLnet/minecraft/enchantment/EnchantmentHelper;getPossibleEntries(ILnet/minecraft/item/ItemStack;Ljava/util/stream/Stream;)Ljava/util/List;intermediary method_8229Lnet/minecraft/class_1890;method_8229(ILnet/minecraft/class_1799;Ljava/util/stream/Stream;)Ljava/util/List;official aLdhl;a(ILdaw;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 applyEnchantmentProviderLnet/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;)Vintermediary method_60137Lnet/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;)Vofficial aLdhl;a(Ldaw;Ljw;Lalt;Lbvj;Lbao;)V
-