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