Package net.minecraft.enchantment
Class EnchantmentHelper
java.lang.Object
net.minecraft.enchantment.EnchantmentHelper
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static interface
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Map<Enchantment,
Integer> deserializeEnchantments
(ListNBT p_226652_0_) static void
doPostDamageEffects
(LivingEntity p_151385_0_, Entity p_151385_1_) static void
doPostHurtEffects
(LivingEntity p_151384_0_, Entity p_151384_1_) static ItemStack
enchantItem
(Random p_77504_0_, ItemStack p_77504_1_, int p_77504_2_, boolean p_77504_3_) static void
filterCompatibleEnchantments
(List<EnchantmentData> p_185282_0_, EnchantmentData p_185282_1_) static List<EnchantmentData>
getAvailableEnchantmentResults
(int p_185291_0_, ItemStack p_185291_1_, boolean p_185291_2_) static int
getBlockEfficiency
(LivingEntity p_185293_0_) static float
getDamageBonus
(ItemStack p_152377_0_, CreatureAttribute p_152377_1_) static int
getDamageProtection
(Iterable<ItemStack> p_77508_0_, DamageSource p_77508_1_) static int
getDepthStrider
(LivingEntity p_185294_0_) static int
getEnchantmentCost
(Random p_77514_0_, int p_77514_1_, int p_77514_2_, ItemStack p_77514_3_) static int
getEnchantmentLevel
(Enchantment p_185284_0_, LivingEntity p_185284_1_) static Map<Enchantment,
Integer> getEnchantments
(ItemStack p_82781_0_) static int
getFireAspect
(LivingEntity p_90036_0_) static int
getFishingLuckBonus
(ItemStack p_191529_0_) static int
getFishingSpeedBonus
(ItemStack p_191528_0_) static int
getItemEnchantmentLevel
(Enchantment p_77506_0_, ItemStack p_77506_1_) static int
getKnockbackBonus
(LivingEntity p_77501_0_) static int
getLoyalty
(ItemStack p_203191_0_) static int
getMobLooting
(LivingEntity p_185283_0_) static Map.Entry<EquipmentSlotType,
ItemStack> getRandomItemWith
(Enchantment p_222189_0_, LivingEntity p_222189_1_) static Map.Entry<EquipmentSlotType,
ItemStack> getRandomItemWith
(Enchantment p_234844_0_, LivingEntity p_234844_1_, Predicate<ItemStack> p_234844_2_) static int
getRespiration
(LivingEntity p_185292_0_) static int
getRiptide
(ItemStack p_203190_0_) static float
getSweepingDamageRatio
(LivingEntity p_191527_0_) static boolean
hasAquaAffinity
(LivingEntity p_185287_0_) static boolean
hasBindingCurse
(ItemStack p_190938_0_) static boolean
hasChanneling
(ItemStack p_203192_0_) static boolean
hasFrostWalker
(LivingEntity p_189869_0_) static boolean
hasSoulSpeed
(LivingEntity p_234846_0_) static boolean
hasVanishingCurse
(ItemStack p_190939_0_) static boolean
isEnchantmentCompatible
(Collection<Enchantment> p_201840_0_, Enchantment p_201840_1_) private static void
runIterationOnInventory
(EnchantmentHelper.IEnchantmentVisitor p_77516_0_, Iterable<ItemStack> p_77516_1_) private static void
runIterationOnItem
(EnchantmentHelper.IEnchantmentVisitor p_77518_0_, ItemStack p_77518_1_) static List<EnchantmentData>
selectEnchantment
(Random p_77513_0_, ItemStack p_77513_1_, int p_77513_2_, boolean p_77513_3_) static void
setEnchantments
(Map<Enchantment, Integer> p_82782_0_, ItemStack p_82782_1_)
-
Constructor Details
-
EnchantmentHelper
public EnchantmentHelper()
-
-
Method Details
-
getItemEnchantmentLevel
-
getEnchantments
-
deserializeEnchantments
-
setEnchantments
-
runIterationOnItem
private static void runIterationOnItem(EnchantmentHelper.IEnchantmentVisitor p_77518_0_, ItemStack p_77518_1_) -
runIterationOnInventory
private static void runIterationOnInventory(EnchantmentHelper.IEnchantmentVisitor p_77516_0_, Iterable<ItemStack> p_77516_1_) -
getDamageProtection
-
getDamageBonus
-
getSweepingDamageRatio
-
doPostHurtEffects
-
doPostDamageEffects
-
getEnchantmentLevel
-
getKnockbackBonus
-
getFireAspect
-
getRespiration
-
getDepthStrider
-
getBlockEfficiency
-
getFishingLuckBonus
-
getFishingSpeedBonus
-
getMobLooting
-
hasAquaAffinity
-
hasFrostWalker
-
hasSoulSpeed
-
hasBindingCurse
-
hasVanishingCurse
-
getLoyalty
-
getRiptide
-
hasChanneling
-
getRandomItemWith
@Nullable public static Map.Entry<EquipmentSlotType,ItemStack> getRandomItemWith(Enchantment p_222189_0_, LivingEntity p_222189_1_) -
getRandomItemWith
@Nullable public static Map.Entry<EquipmentSlotType,ItemStack> getRandomItemWith(Enchantment p_234844_0_, LivingEntity p_234844_1_, Predicate<ItemStack> p_234844_2_) -
getEnchantmentCost
-
enchantItem
-
selectEnchantment
public static List<EnchantmentData> selectEnchantment(Random p_77513_0_, ItemStack p_77513_1_, int p_77513_2_, boolean p_77513_3_) -
filterCompatibleEnchantments
public static void filterCompatibleEnchantments(List<EnchantmentData> p_185282_0_, EnchantmentData p_185282_1_) -
isEnchantmentCompatible
public static boolean isEnchantmentCompatible(Collection<Enchantment> p_201840_0_, Enchantment p_201840_1_) -
getAvailableEnchantmentResults
public static List<EnchantmentData> getAvailableEnchantmentResults(int p_185291_0_, ItemStack p_185291_1_, boolean p_185291_2_)
-