Package net.minecraft.enchantment
Class EnchantmentHelper
java.lang.Object
net.minecraft.enchantment.EnchantmentHelper
- Mappings:
Namespace Name official almintermediary net/minecraft/class_1129named net/minecraft/enchantment/EnchantmentHelper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface(package private) static final class(package private) static final class(package private) static final class(package private) static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final EnchantmentHelper.DamageModifierprivate static final EnchantmentHelper.OnAttackedWithprivate static final EnchantmentHelper.OnDamagedWithprivate static final EnchantmentHelper.ProtectionModifier -
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) private static voidforEachEnchantment(EnchantmentHelper.Consumer consumer, ItemStack stack) 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 floatgetAttackDamage(ItemStack stack, EntityGroup group) 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 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.
-
Field Details
-
PROTECTION_CONSUMER
- Mappings:
Namespace Name Mixin selector official aLalm;a:Lalm$e;intermediary field_4490Lnet/minecraft/class_1129;field_4490:Lnet/minecraft/class_1129$class_1133;named PROTECTION_CONSUMERLnet/minecraft/enchantment/EnchantmentHelper;PROTECTION_CONSUMER:Lnet/minecraft/enchantment/EnchantmentHelper$ProtectionModifier;
-
DAMAGE_CONSUMER
- Mappings:
Namespace Name Mixin selector official bLalm;b:Lalm$d;intermediary field_4491Lnet/minecraft/class_1129;field_4491:Lnet/minecraft/class_1129$class_1132;named DAMAGE_CONSUMERLnet/minecraft/enchantment/EnchantmentHelper;DAMAGE_CONSUMER:Lnet/minecraft/enchantment/EnchantmentHelper$DamageModifier;
-
ON_DAMAGE_CONSUMER
- Mappings:
Namespace Name Mixin selector official cLalm;c:Lalm$b;intermediary field_7159Lnet/minecraft/class_1129;field_7159:Lnet/minecraft/class_1129$class_1738;named ON_DAMAGE_CONSUMERLnet/minecraft/enchantment/EnchantmentHelper;ON_DAMAGE_CONSUMER:Lnet/minecraft/enchantment/EnchantmentHelper$OnDamagedWith;
-
ON_ATTACK_CONSUMER
- Mappings:
Namespace Name Mixin selector official dLalm;d:Lalm$a;intermediary field_7160Lnet/minecraft/class_1129;field_7160:Lnet/minecraft/class_1129$class_1737;named ON_ATTACK_CONSUMERLnet/minecraft/enchantment/EnchantmentHelper;ON_ATTACK_CONSUMER:Lnet/minecraft/enchantment/EnchantmentHelper$OnAttackedWith;
-
-
Constructor Details
-
EnchantmentHelper
public EnchantmentHelper()
-
-
Method Details
-
getLevel
Gets the level of an enchantment on an item stack.- Mappings:
Namespace Name Mixin selector official aLalm;a(Lalk;Laip;)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 aLalm;a(Laip;)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 aLalm;a(Ljava/util/Map;Laip;)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
-
forEachEnchantment
- Mappings:
Namespace Name Mixin selector official aLalm;a(Lalm$c;Laip;)Vintermediary method_3526Lnet/minecraft/class_1129;method_3526(Lnet/minecraft/class_1129$class_1131;Lnet/minecraft/class_1071;)Vnamed forEachEnchantmentLnet/minecraft/enchantment/EnchantmentHelper;forEachEnchantment(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 aLalm;a(Lalm$c;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 aLalm;a(Ljava/lang/Iterable;Lur;)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
-
getAttackDamage
- Mappings:
Namespace Name Mixin selector official aLalm;a(Laip;Lvu;)Fintermediary method_6384Lnet/minecraft/class_1129;method_6384(Lnet/minecraft/class_1071;Lnet/minecraft/class_873;)Fnamed getAttackDamageLnet/minecraft/enchantment/EnchantmentHelper;getAttackDamage(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/EntityGroup;)F
-
getSweepingMultiplier
- Mappings:
Namespace Name Mixin selector official aLalm;a(Lvp;)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 aLalm;a(Lvp;Lvg;)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 bLalm;b(Lvp;Lvg;)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 aLalm;a(Lalk;Lvp;)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 bLalm;b(Lvp;)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 cLalm;c(Lvp;)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 dLalm;d(Lvp;)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 eLalm;e(Lvp;)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 fLalm;f(Lvp;)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 bLalm;b(Laip;)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 cLalm;c(Laip;)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 gLalm;g(Lvp;)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 hLalm;h(Lvp;)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 iLalm;i(Lvp;)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 dLalm;d(Laip;)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 eLalm;e(Laip;)Zintermediary method_13680Lnet/minecraft/class_1129;method_13680(Lnet/minecraft/class_1071;)Znamed hasVanishingCurseLnet/minecraft/enchantment/EnchantmentHelper;hasVanishingCurse(Lnet/minecraft/item/ItemStack;)Z
-
chooseEquipmentWith
- Mappings:
Namespace Name Mixin selector official bLalm;b(Lalk;Lvp;)Laip;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 aLalm;a(Ljava/util/Random;IILaip;)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 aLalm;a(Ljava/util/Random;Laip;IZ)Laip;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 bLalm;b(Ljava/util/Random;Laip;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 aLalm;a(Ljava/util/List;Laln;)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
-
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 aLalm;a(ILaip;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;
-