Package net.minecraft.enchantment
Class EnchantmentHelper
java.lang.Object
net.minecraft.enchantment.EnchantmentHelper
- Mappings:
Namespace Name official ackintermediary 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.ProtectionModifierprivate static final Random -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ItemStackaddRandomEnchantment(Random random, ItemStack stack, int int2) 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 ItemStackchooseEquipmentWith(Enchantment enchantment, LivingEntity entity) private static voidforEachEnchantment(EnchantmentHelper.Consumer consumer, ItemStack stack) Gets the enchantments on an item stack.static floatgetAttackDamage(ItemStack stack, EntityGroup group) static List<EnchantmentLevelEntry>getEnchantmentInfoEntries(Random random, ItemStack stack, int int2) static intgetFireAspect(LivingEntity entity) static intgetKnockback(LivingEntity entity) static intmethod_3519(int id, ItemStack stack) static intmethod_3520(int int2, ItemStack[] itemStack) static intmethod_3524(ItemStack[] itemStack, DamageSource damageSource) private static voidmethod_3527(EnchantmentHelper.Consumer consumer, ItemStack[] stacks) static Map<Integer,EnchantmentLevelEntry> method_3528(int int2, ItemStack stack) static intmethod_5495(LivingEntity entity) static booleanmethod_5496(LivingEntity entity) static intmethod_5497(LivingEntity entity) static intmethod_5498(LivingEntity entity) static booleanmethod_5499(LivingEntity entity) static intmethod_6389(LivingEntity entity) static intmethod_6390(LivingEntity entity) static intmethod_8449(Entity rntity) static intmethod_8450(Entity entity) static voidonTargetDamaged(LivingEntity user, Entity attacker) static voidonUserDamaged(LivingEntity user, Entity attacker) static voidSets the enchantments on an item stack.
-
Field Details
-
RANDOM
- Mappings:
Namespace Name Mixin selector official aLack;a:Ljava/util/Random;intermediary field_4489Lnet/minecraft/class_1129;field_4489:Ljava/util/Random;named RANDOMLnet/minecraft/enchantment/EnchantmentHelper;RANDOM:Ljava/util/Random;
-
PROTECTION_CONSUMER
- Mappings:
Namespace Name Mixin selector official bLack;b:Lack$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 cLack;c:Lack$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 dLack;d:Lack$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 eLack;e:Lack$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
-
method_3519
- Mappings:
Namespace Name Mixin selector official aLack;a(ILzx;)Iintermediary method_3519Lnet/minecraft/class_1129;method_3519(ILnet/minecraft/class_1071;)Inamed method_3519Lnet/minecraft/enchantment/EnchantmentHelper;method_3519(ILnet/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 aLack;a(Lzx;)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 aLack;a(Ljava/util/Map;Lzx;)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_3520
- Mappings:
Namespace Name Mixin selector official aLack;a(I[Lzx;)Iintermediary method_3520Lnet/minecraft/class_1129;method_3520(I[Lnet/minecraft/class_1071;)Inamed method_3520Lnet/minecraft/enchantment/EnchantmentHelper;method_3520(I[Lnet/minecraft/item/ItemStack;)I
-
forEachEnchantment
- Mappings:
Namespace Name Mixin selector official aLack;a(Lack$c;Lzx;)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
-
method_3527
- Mappings:
Namespace Name Mixin selector official aLack;a(Lack$c;[Lzx;)Vintermediary method_3527Lnet/minecraft/class_1129;method_3527(Lnet/minecraft/class_1129$class_1131;[Lnet/minecraft/class_1071;)Vnamed method_3527Lnet/minecraft/enchantment/EnchantmentHelper;method_3527(Lnet/minecraft/enchantment/EnchantmentHelper$Consumer;[Lnet/minecraft/item/ItemStack;)V
-
method_3524
- Mappings:
Namespace Name Mixin selector official aLack;a([Lzx;Low;)Iintermediary method_3524Lnet/minecraft/class_1129;method_3524([Lnet/minecraft/class_1071;Lnet/minecraft/class_856;)Inamed method_3524Lnet/minecraft/enchantment/EnchantmentHelper;method_3524([Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/damage/DamageSource;)I
-
getAttackDamage
- Mappings:
Namespace Name Mixin selector official aLack;a(Lzx;Lpw;)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
-
onUserDamaged
- Mappings:
Namespace Name Mixin selector official aLack;a(Lpr;Lpk;)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 bLack;b(Lpr;Lpk;)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
-
getKnockback
- Mappings:
Namespace Name Mixin selector official aLack;a(Lpr;)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 bLack;b(Lpr;)Iintermediary method_5491Lnet/minecraft/class_1129;method_5491(Lnet/minecraft/class_1699;)Inamed getFireAspectLnet/minecraft/enchantment/EnchantmentHelper;getFireAspect(Lnet/minecraft/entity/LivingEntity;)I
-
method_8449
- Mappings:
Namespace Name Mixin selector official aLack;a(Lpk;)Iintermediary method_8449Lnet/minecraft/class_1129;method_8449(Lnet/minecraft/class_864;)Inamed method_8449Lnet/minecraft/enchantment/EnchantmentHelper;method_8449(Lnet/minecraft/entity/Entity;)I
-
method_8450
- Mappings:
Namespace Name Mixin selector official bLack;b(Lpk;)Iintermediary method_8450Lnet/minecraft/class_1129;method_8450(Lnet/minecraft/class_864;)Inamed method_8450Lnet/minecraft/enchantment/EnchantmentHelper;method_8450(Lnet/minecraft/entity/Entity;)I
-
method_5495
- Mappings:
Namespace Name Mixin selector official cLack;c(Lpr;)Iintermediary method_5495Lnet/minecraft/class_1129;method_5495(Lnet/minecraft/class_1699;)Inamed method_5495Lnet/minecraft/enchantment/EnchantmentHelper;method_5495(Lnet/minecraft/entity/LivingEntity;)I
-
method_5496
- Mappings:
Namespace Name Mixin selector official eLack;e(Lpr;)Zintermediary method_5496Lnet/minecraft/class_1129;method_5496(Lnet/minecraft/class_1699;)Znamed method_5496Lnet/minecraft/enchantment/EnchantmentHelper;method_5496(Lnet/minecraft/entity/LivingEntity;)Z
-
method_5497
- Mappings:
Namespace Name Mixin selector official fLack;f(Lpr;)Iintermediary method_5497Lnet/minecraft/class_1129;method_5497(Lnet/minecraft/class_1699;)Inamed method_5497Lnet/minecraft/enchantment/EnchantmentHelper;method_5497(Lnet/minecraft/entity/LivingEntity;)I
-
method_6389
- Mappings:
Namespace Name Mixin selector official gLack;g(Lpr;)Iintermediary method_6389Lnet/minecraft/class_1129;method_6389(Lnet/minecraft/class_1699;)Inamed method_6389Lnet/minecraft/enchantment/EnchantmentHelper;method_6389(Lnet/minecraft/entity/LivingEntity;)I
-
method_6390
- Mappings:
Namespace Name Mixin selector official hLack;h(Lpr;)Iintermediary method_6390Lnet/minecraft/class_1129;method_6390(Lnet/minecraft/class_1699;)Inamed method_6390Lnet/minecraft/enchantment/EnchantmentHelper;method_6390(Lnet/minecraft/entity/LivingEntity;)I
-
method_5498
- Mappings:
Namespace Name Mixin selector official iLack;i(Lpr;)Iintermediary method_5498Lnet/minecraft/class_1129;method_5498(Lnet/minecraft/class_1699;)Inamed method_5498Lnet/minecraft/enchantment/EnchantmentHelper;method_5498(Lnet/minecraft/entity/LivingEntity;)I
-
method_5499
- Mappings:
Namespace Name Mixin selector official jLack;j(Lpr;)Zintermediary method_5499Lnet/minecraft/class_1129;method_5499(Lnet/minecraft/class_1699;)Znamed method_5499Lnet/minecraft/enchantment/EnchantmentHelper;method_5499(Lnet/minecraft/entity/LivingEntity;)Z
-
chooseEquipmentWith
- Mappings:
Namespace Name Mixin selector official aLack;a(Laci;Lpr;)Lzx;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 aLack;a(Ljava/util/Random;IILzx;)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
-
addRandomEnchantment
- Mappings:
Namespace Name Mixin selector official aLack;a(Ljava/util/Random;Lzx;I)Lzx;intermediary method_6385Lnet/minecraft/class_1129;method_6385(Ljava/util/Random;Lnet/minecraft/class_1071;I)Lnet/minecraft/class_1071;named addRandomEnchantmentLnet/minecraft/enchantment/EnchantmentHelper;addRandomEnchantment(Ljava/util/Random;Lnet/minecraft/item/ItemStack;I)Lnet/minecraft/item/ItemStack;
-
getEnchantmentInfoEntries
public static List<EnchantmentLevelEntry> getEnchantmentInfoEntries(Random random, ItemStack stack, int int2) - Mappings:
Namespace Name Mixin selector official bLack;b(Ljava/util/Random;Lzx;I)Ljava/util/List;intermediary method_3529Lnet/minecraft/class_1129;method_3529(Ljava/util/Random;Lnet/minecraft/class_1071;I)Ljava/util/List;named getEnchantmentInfoEntriesLnet/minecraft/enchantment/EnchantmentHelper;getEnchantmentInfoEntries(Ljava/util/Random;Lnet/minecraft/item/ItemStack;I)Ljava/util/List;
-
method_3528
- Mappings:
Namespace Name Mixin selector official bLack;b(ILzx;)Ljava/util/Map;intermediary method_3528Lnet/minecraft/class_1129;method_3528(ILnet/minecraft/class_1071;)Ljava/util/Map;named method_3528Lnet/minecraft/enchantment/EnchantmentHelper;method_3528(ILnet/minecraft/item/ItemStack;)Ljava/util/Map;
-