Package net.minecraft.enchantment
Class EnchantmentHelper
java.lang.Object
net.minecraft.enchantment.EnchantmentHelper
- Mappings:
Namespace Name official awgintermediary net/minecraft/class_1129named net/minecraft/enchantment/EnchantmentHelper
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 ItemStackchooseEquipmentWith(Enchantment enchantment, LivingEntity entity) static ItemStackEnchants thetargetitem stack and returns it.private static voidforEachEnchantment(EnchantmentHelper.Consumer consumer, Iterable<ItemStack> stacks) static List<EnchantmentLevelEntry>generateEnchantments(Random random, ItemStack stack, int level, boolean treasureAllowed) Generate the enchantments for enchanting thestack.static Map<Enchantment,Integer> Gets the enchantments on an item stack.static intgetDepthStrider(LivingEntity entity) static intgetEfficiency(LivingEntity entity) static intgetEquipmentLevel(Enchantment enchantment, LivingEntity entity) Returns the highest level of the passed enchantment in the enchantment's applicable equipment slots' item stacks.static intgetFireAspect(LivingEntity entity) static intgetKnockback(LivingEntity entity) static intgetLevel(Enchantment enchantment, ItemStack stack) Gets the level of an enchantment on an item stack.static intgetLooting(LivingEntity stack) static intgetLuckOfTheSea(ItemStack stack) static intstatic List<EnchantmentLevelEntry>getPossibleEntries(int power, ItemStack stack, boolean treasureAllowed) Gets all the possible entries for enchanting thestackat the givenpower.static intgetProtectionAmount(Iterable<ItemStack> stacks, DamageSource source) static intgetRespiration(LivingEntity entity) static floatgetSweepingMultiplier(LivingEntity entity) static booleanhasAquaAffinity(LivingEntity entity) static booleanhasBindingCurse(ItemStack stack) static booleanhasFrostWalker(LivingEntity entity) static booleanhasVanishingCurse(ItemStack stack) static floatmethod_16260(ItemStack itemStack, class_3462 class_3462) private static voidmethod_16261(EnchantmentHelper.Consumer consumer, ItemStack itemStack) static booleanmethod_16262(Collection<Enchantment> collection, Enchantment enchantment) static intmethod_16266(ItemStack itemStack) static intmethod_16267(ItemStack itemStack) static booleanmethod_16268(ItemStack itemStack) static voidonTargetDamaged(LivingEntity user, Entity attacker) static voidonUserDamaged(LivingEntity user, Entity attacker) static voidremoveConflicts(List<EnchantmentLevelEntry> possibleEntries, EnchantmentLevelEntry pickedEntry) Remove entries conflicting with the picked entry from the possible entries.static voidset(Map<Enchantment, Integer> enchantments, ItemStack stack) Sets the enchantments on an item stack.
-
Constructor Details
-
EnchantmentHelper
public EnchantmentHelper()
-
-
Method Details
-
getLevel
Gets the level of an enchantment on an item stack.- Mappings:
Namespace Name Mixin selector official aLawg;a(Lawe;Late;)Iintermediary method_11452Lnet/minecraft/class_1129;method_11452(Lnet/minecraft/class_1127;Lnet/minecraft/class_1071;)Inamed getLevelLnet/minecraft/enchantment/EnchantmentHelper;getLevel(Lnet/minecraft/enchantment/Enchantment;Lnet/minecraft/item/ItemStack;)I
-
get
Gets the enchantments on an item stack.For enchanted books, it retrieves from the item stack's stored than regular enchantments.
- See Also:
-
ItemStack.getEnchantments()net.minecraft.item.EnchantedBookItem#getEnchantmentTag(ItemStack)
- Mappings:
Namespace Name Mixin selector official aLawg;a(Late;)Ljava/util/Map;intermediary method_4648Lnet/minecraft/class_1129;method_4648(Lnet/minecraft/class_1071;)Ljava/util/Map;named getLnet/minecraft/enchantment/EnchantmentHelper;get(Lnet/minecraft/item/ItemStack;)Ljava/util/Map;
-
set
Sets the enchantments on an item stack.For enchanted books, it sets the enchantments to the item stack's stored enchantments than regular enchantments.
- See Also:
-
ItemStack.getEnchantments()net.minecraft.item.EnchantedBookItem#getEnchantmentTag(ItemStack)
- Mappings:
Namespace Name Mixin selector official aLawg;a(Ljava/util/Map;Late;)Vintermediary method_4645Lnet/minecraft/class_1129;method_4645(Ljava/util/Map;Lnet/minecraft/class_1071;)Vnamed setLnet/minecraft/enchantment/EnchantmentHelper;set(Ljava/util/Map;Lnet/minecraft/item/ItemStack;)V
-
method_16261
- Mappings:
Namespace Name Mixin selector official aLawg;a(Lawg$a;Late;)Vintermediary method_16261Lnet/minecraft/class_1129;method_16261(Lnet/minecraft/class_1129$class_1131;Lnet/minecraft/class_1071;)Vnamed method_16261Lnet/minecraft/enchantment/EnchantmentHelper;method_16261(Lnet/minecraft/enchantment/EnchantmentHelper$Consumer;Lnet/minecraft/item/ItemStack;)V
-
forEachEnchantment
private static void forEachEnchantment(EnchantmentHelper.Consumer consumer, Iterable<ItemStack> stacks) - Mappings:
Namespace Name Mixin selector official aLawg;a(Lawg$a;Ljava/lang/Iterable;)Vintermediary method_11454Lnet/minecraft/class_1129;method_11454(Lnet/minecraft/class_1129$class_1131;Ljava/lang/Iterable;)Vnamed forEachEnchantmentLnet/minecraft/enchantment/EnchantmentHelper;forEachEnchantment(Lnet/minecraft/enchantment/EnchantmentHelper$Consumer;Ljava/lang/Iterable;)V
-
getProtectionAmount
- Mappings:
Namespace Name Mixin selector official aLawg;a(Ljava/lang/Iterable;Laea;)Iintermediary method_11455Lnet/minecraft/class_1129;method_11455(Ljava/lang/Iterable;Lnet/minecraft/class_856;)Inamed getProtectionAmountLnet/minecraft/enchantment/EnchantmentHelper;getProtectionAmount(Ljava/lang/Iterable;Lnet/minecraft/entity/damage/DamageSource;)I
-
method_16260
- Mappings:
Namespace Name Mixin selector official aLawg;a(Late;Lafd;)Fintermediary method_16260Lnet/minecraft/class_1129;method_16260(Lnet/minecraft/class_1071;Lnet/minecraft/class_3462;)Fnamed method_16260Lnet/minecraft/enchantment/EnchantmentHelper;method_16260(Lnet/minecraft/item/ItemStack;Lnet/minecraft/class_3462;)F
-
getSweepingMultiplier
- Mappings:
Namespace Name Mixin selector official aLawg;a(Lafa;)Fintermediary method_13676Lnet/minecraft/class_1129;method_13676(Lnet/minecraft/class_1699;)Fnamed getSweepingMultiplierLnet/minecraft/enchantment/EnchantmentHelper;getSweepingMultiplier(Lnet/minecraft/entity/LivingEntity;)F
-
onUserDamaged
- Mappings:
Namespace Name Mixin selector official aLawg;a(Lafa;Laer;)Vintermediary method_6386Lnet/minecraft/class_1129;method_6386(Lnet/minecraft/class_1699;Lnet/minecraft/class_864;)Vnamed onUserDamagedLnet/minecraft/enchantment/EnchantmentHelper;onUserDamaged(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/Entity;)V
-
onTargetDamaged
- Mappings:
Namespace Name Mixin selector official bLawg;b(Lafa;Laer;)Vintermediary method_6388Lnet/minecraft/class_1129;method_6388(Lnet/minecraft/class_1699;Lnet/minecraft/class_864;)Vnamed onTargetDamagedLnet/minecraft/enchantment/EnchantmentHelper;onTargetDamaged(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/Entity;)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 checkedenchantment- the enchantment- Returns:
- the highest level of the passed enchantment in the enchantment's applicable equipment slots' item stacks
- Mappings:
Namespace Name Mixin selector official aLawg;a(Lawe;Lafa;)Iintermediary method_11453Lnet/minecraft/class_1129;method_11453(Lnet/minecraft/class_1127;Lnet/minecraft/class_1699;)Inamed getEquipmentLevelLnet/minecraft/enchantment/EnchantmentHelper;getEquipmentLevel(Lnet/minecraft/enchantment/Enchantment;Lnet/minecraft/entity/LivingEntity;)I
-
getKnockback
- Mappings:
Namespace Name Mixin selector official bLawg;b(Lafa;)Iintermediary method_5493Lnet/minecraft/class_1129;method_5493(Lnet/minecraft/class_1699;)Inamed getKnockbackLnet/minecraft/enchantment/EnchantmentHelper;getKnockback(Lnet/minecraft/entity/LivingEntity;)I
-
getFireAspect
- Mappings:
Namespace Name Mixin selector official cLawg;c(Lafa;)Iintermediary method_5491Lnet/minecraft/class_1129;method_5491(Lnet/minecraft/class_1699;)Inamed getFireAspectLnet/minecraft/enchantment/EnchantmentHelper;getFireAspect(Lnet/minecraft/entity/LivingEntity;)I
-
getRespiration
- Mappings:
Namespace Name Mixin selector official dLawg;d(Lafa;)Iintermediary method_11458Lnet/minecraft/class_1129;method_11458(Lnet/minecraft/class_1699;)Inamed getRespirationLnet/minecraft/enchantment/EnchantmentHelper;getRespiration(Lnet/minecraft/entity/LivingEntity;)I
-
getDepthStrider
- Mappings:
Namespace Name Mixin selector official eLawg;e(Lafa;)Iintermediary method_11459Lnet/minecraft/class_1129;method_11459(Lnet/minecraft/class_1699;)Inamed getDepthStriderLnet/minecraft/enchantment/EnchantmentHelper;getDepthStrider(Lnet/minecraft/entity/LivingEntity;)I
-
getEfficiency
- Mappings:
Namespace Name Mixin selector official fLawg;f(Lafa;)Iintermediary method_11460Lnet/minecraft/class_1129;method_11460(Lnet/minecraft/class_1699;)Inamed getEfficiencyLnet/minecraft/enchantment/EnchantmentHelper;getEfficiency(Lnet/minecraft/entity/LivingEntity;)I
-
getLuckOfTheSea
- Mappings:
Namespace Name Mixin selector official bLawg;b(Late;)Iintermediary method_13677Lnet/minecraft/class_1129;method_13677(Lnet/minecraft/class_1071;)Inamed getLuckOfTheSeaLnet/minecraft/enchantment/EnchantmentHelper;getLuckOfTheSea(Lnet/minecraft/item/ItemStack;)I
-
getLure
- Mappings:
Namespace Name Mixin selector official cLawg;c(Late;)Iintermediary method_13678Lnet/minecraft/class_1129;method_13678(Lnet/minecraft/class_1071;)Inamed getLureLnet/minecraft/enchantment/EnchantmentHelper;getLure(Lnet/minecraft/item/ItemStack;)I
-
getLooting
- Mappings:
Namespace Name Mixin selector official gLawg;g(Lafa;)Iintermediary method_11461Lnet/minecraft/class_1129;method_11461(Lnet/minecraft/class_1699;)Inamed getLootingLnet/minecraft/enchantment/EnchantmentHelper;getLooting(Lnet/minecraft/entity/LivingEntity;)I
-
hasAquaAffinity
- Mappings:
Namespace Name Mixin selector official hLawg;h(Lafa;)Zintermediary method_11462Lnet/minecraft/class_1129;method_11462(Lnet/minecraft/class_1699;)Znamed hasAquaAffinityLnet/minecraft/enchantment/EnchantmentHelper;hasAquaAffinity(Lnet/minecraft/entity/LivingEntity;)Z
-
hasFrostWalker
- Mappings:
Namespace Name Mixin selector official iLawg;i(Lafa;)Zintermediary method_13312Lnet/minecraft/class_1129;method_13312(Lnet/minecraft/class_1699;)Znamed hasFrostWalkerLnet/minecraft/enchantment/EnchantmentHelper;hasFrostWalker(Lnet/minecraft/entity/LivingEntity;)Z
-
hasBindingCurse
- Mappings:
Namespace Name Mixin selector official dLawg;d(Late;)Zintermediary method_13679Lnet/minecraft/class_1129;method_13679(Lnet/minecraft/class_1071;)Znamed hasBindingCurseLnet/minecraft/enchantment/EnchantmentHelper;hasBindingCurse(Lnet/minecraft/item/ItemStack;)Z
-
hasVanishingCurse
- Mappings:
Namespace Name Mixin selector official eLawg;e(Late;)Zintermediary method_13680Lnet/minecraft/class_1129;method_13680(Lnet/minecraft/class_1071;)Znamed hasVanishingCurseLnet/minecraft/enchantment/EnchantmentHelper;hasVanishingCurse(Lnet/minecraft/item/ItemStack;)Z
-
method_16266
- Mappings:
Namespace Name Mixin selector official fLawg;f(Late;)Iintermediary method_16266Lnet/minecraft/class_1129;method_16266(Lnet/minecraft/class_1071;)Inamed method_16266Lnet/minecraft/enchantment/EnchantmentHelper;method_16266(Lnet/minecraft/item/ItemStack;)I
-
method_16267
- Mappings:
Namespace Name Mixin selector official gLawg;g(Late;)Iintermediary method_16267Lnet/minecraft/class_1129;method_16267(Lnet/minecraft/class_1071;)Inamed method_16267Lnet/minecraft/enchantment/EnchantmentHelper;method_16267(Lnet/minecraft/item/ItemStack;)I
-
method_16268
- Mappings:
Namespace Name Mixin selector official hLawg;h(Late;)Zintermediary method_16268Lnet/minecraft/class_1129;method_16268(Lnet/minecraft/class_1071;)Znamed method_16268Lnet/minecraft/enchantment/EnchantmentHelper;method_16268(Lnet/minecraft/item/ItemStack;)Z
-
chooseEquipmentWith
- Mappings:
Namespace Name Mixin selector official bLawg;b(Lawe;Lafa;)Late;intermediary method_5490Lnet/minecraft/class_1129;method_5490(Lnet/minecraft/class_1127;Lnet/minecraft/class_1699;)Lnet/minecraft/class_1071;named chooseEquipmentWithLnet/minecraft/enchantment/EnchantmentHelper;chooseEquipmentWith(Lnet/minecraft/enchantment/Enchantment;Lnet/minecraft/entity/LivingEntity;)Lnet/minecraft/item/ItemStack;
-
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 official aLawg;a(Ljava/util/Random;IILate;)Iintermediary method_3521Lnet/minecraft/class_1129;method_3521(Ljava/util/Random;IILnet/minecraft/class_1071;)Inamed calculateRequiredExperienceLevelLnet/minecraft/enchantment/EnchantmentHelper;calculateRequiredExperienceLevel(Ljava/util/Random;IILnet/minecraft/item/ItemStack;)I
-
enchant
Enchants thetargetitem stack and returns it.- Parameters:
level- the experience leveltreasureAllowed- whether treasure enchantments may appearrandom- the seedtarget- the item stack to enchant- Mappings:
Namespace Name Mixin selector official aLawg;a(Ljava/util/Random;Late;IZ)Late;intermediary method_6385Lnet/minecraft/class_1129;method_6385(Ljava/util/Random;Lnet/minecraft/class_1071;IZ)Lnet/minecraft/class_1071;named enchantLnet/minecraft/enchantment/EnchantmentHelper;enchant(Ljava/util/Random;Lnet/minecraft/item/ItemStack;IZ)Lnet/minecraft/item/ItemStack;
-
generateEnchantments
public static List<EnchantmentLevelEntry> generateEnchantments(Random random, ItemStack stack, int level, boolean treasureAllowed) Generate the enchantments for enchanting thestack.- Mappings:
Namespace Name Mixin selector official bLawg;b(Ljava/util/Random;Late;IZ)Ljava/util/List;intermediary method_11457Lnet/minecraft/class_1129;method_11457(Ljava/util/Random;Lnet/minecraft/class_1071;IZ)Ljava/util/List;named generateEnchantmentsLnet/minecraft/enchantment/EnchantmentHelper;generateEnchantments(Ljava/util/Random;Lnet/minecraft/item/ItemStack;IZ)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 official aLawg;a(Ljava/util/List;Lawh;)Vintermediary method_11456Lnet/minecraft/class_1129;method_11456(Ljava/util/List;Lnet/minecraft/class_1134;)Vnamed removeConflictsLnet/minecraft/enchantment/EnchantmentHelper;removeConflicts(Ljava/util/List;Lnet/minecraft/enchantment/EnchantmentLevelEntry;)V
-
method_16262
- Mappings:
Namespace Name Mixin selector official aLawg;a(Ljava/util/Collection;Lawe;)Zintermediary method_16262Lnet/minecraft/class_1129;method_16262(Ljava/util/Collection;Lnet/minecraft/class_1127;)Znamed method_16262Lnet/minecraft/enchantment/EnchantmentHelper;method_16262(Ljava/util/Collection;Lnet/minecraft/enchantment/Enchantment;)Z
-
getPossibleEntries
public static List<EnchantmentLevelEntry> getPossibleEntries(int power, ItemStack stack, boolean treasureAllowed) Gets all the possible entries for enchanting thestackat the givenpower.- Mappings:
Namespace Name Mixin selector official aLawg;a(ILate;Z)Ljava/util/List;intermediary method_11451Lnet/minecraft/class_1129;method_11451(ILnet/minecraft/class_1071;Z)Ljava/util/List;named getPossibleEntriesLnet/minecraft/enchantment/EnchantmentHelper;getPossibleEntries(ILnet/minecraft/item/ItemStack;Z)Ljava/util/List;
-