Class EnchantmentHelper
java.lang.Object
net.minecraft.world.item.enchantment.EnchantmentHelper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic floatcalculateArmorBreach(Entity p_329003_, float p_334370_) static booleancanStoreEnchantments(ItemStack p_333572_) static voiddoPostDamageEffects(LivingEntity p_44897_, Entity p_44898_) static voiddoPostHurtEffects(LivingEntity p_44824_, Entity p_44825_) static voiddoPostItemStackHurtEffects(LivingEntity p_330971_, Entity p_330890_, ItemEnchantments p_336148_) static ItemStackenchantItem(FeatureFlagSet p_329514_, RandomSource p_220293_, ItemStack p_220294_, int p_220295_, boolean p_220296_) static voidfilterCompatibleEnchantments(List<EnchantmentInstance> p_44863_, EnchantmentInstance p_44864_) static List<EnchantmentInstance> getAvailableEnchantmentResults(FeatureFlagSet p_334102_, int p_44818_, ItemStack p_44819_, boolean p_44820_) static intgetBlockEfficiency(LivingEntity p_44927_) private static DataComponentType<ItemEnchantments> getComponentType(ItemStack p_335414_) static floatgetDamageBonus(ItemStack p_44834_, EntityType<?> p_331963_) static intgetDamageProtection(Iterable<ItemStack> p_44857_, DamageSource p_44858_) static intgetDepthStrider(LivingEntity p_44923_) static intgetEnchantmentCost(RandomSource p_220288_, int p_220289_, int p_220290_, ItemStack p_220291_) static intgetEnchantmentLevel(Enchantment p_44837_, LivingEntity p_44838_) static ItemEnchantmentsgetEnchantmentsForCrafting(ItemStack p_335659_) static intgetFireAspect(LivingEntity p_44915_) static intgetFishingLuckBonus(ItemStack p_44905_) static intgetFishingSpeedBonus(ItemStack p_44917_) static intgetItemEnchantmentLevel(Enchantment p_44844_, ItemStack p_44845_) static intgetKnockbackBonus(LivingEntity p_44895_) static intgetLoyalty(ItemStack p_44929_) static intgetMobLooting(LivingEntity p_44931_) static Map.Entry<EquipmentSlot, ItemStack> getRandomItemWith(Enchantment p_44907_, LivingEntity p_44908_) static Map.Entry<EquipmentSlot, ItemStack> getRandomItemWith(Enchantment p_44840_, LivingEntity p_44841_, Predicate<ItemStack> p_44842_) static intgetRespiration(LivingEntity p_44919_) static intgetRiptide(ItemStack p_44933_) static floatgetSneakingSpeedBonus(LivingEntity p_220303_) static floatgetSweepingDamageRatio(int p_332009_) static floatgetSweepingDamageRatio(LivingEntity p_44822_) static booleanhasAnyEnchantments(ItemStack p_335287_) static booleanhasAquaAffinity(LivingEntity p_44935_) static booleanhasBindingCurse(ItemStack p_44921_) static booleanhasChanneling(ItemStack p_44937_) static booleanhasFrostWalker(LivingEntity p_44939_) static booleanhasSilkTouch(ItemStack p_273444_) static booleanhasSoulSpeed(LivingEntity p_44943_) static booleanhasVanishingCurse(ItemStack p_44925_) static booleanisEnchantmentCompatible(Collection<Holder<Enchantment>> p_44860_, Enchantment p_44861_) private static voidrunIterationOnInventory(EnchantmentHelper.EnchantmentVisitor p_44854_, Iterable<ItemStack> p_44855_) private static voidrunIterationOnItem(EnchantmentHelper.EnchantmentVisitor p_44851_, ItemStack p_44852_) static List<EnchantmentInstance> selectEnchantment(FeatureFlagSet p_329284_, RandomSource p_220298_, ItemStack p_220299_, int p_220300_, boolean p_220301_) static voidsetEnchantments(ItemStack p_44867_, ItemEnchantments p_330134_) static ItemEnchantmentsupdateEnchantments(ItemStack p_333740_, Consumer<ItemEnchantments.Mutable> p_328467_)
-
Field Details
-
SWIFT_SNEAK_EXTRA_FACTOR
private static final float SWIFT_SNEAK_EXTRA_FACTOR- See Also:
-
-
Constructor Details
-
EnchantmentHelper
public EnchantmentHelper()
-
-
Method Details
-
getItemEnchantmentLevel
-
updateEnchantments
public static ItemEnchantments updateEnchantments(ItemStack p_333740_, Consumer<ItemEnchantments.Mutable> p_328467_) -
canStoreEnchantments
-
setEnchantments
-
getEnchantmentsForCrafting
-
getComponentType
-
hasAnyEnchantments
-
getSweepingDamageRatio
public static float getSweepingDamageRatio(int p_332009_) -
runIterationOnItem
private static void runIterationOnItem(EnchantmentHelper.EnchantmentVisitor p_44851_, ItemStack p_44852_) -
runIterationOnInventory
private static void runIterationOnInventory(EnchantmentHelper.EnchantmentVisitor p_44854_, Iterable<ItemStack> p_44855_) -
getDamageProtection
-
getDamageBonus
-
getSweepingDamageRatio
-
calculateArmorBreach
-
doPostHurtEffects
-
doPostDamageEffects
-
doPostItemStackHurtEffects
public static void doPostItemStackHurtEffects(LivingEntity p_330971_, Entity p_330890_, ItemEnchantments p_336148_) -
getEnchantmentLevel
-
getSneakingSpeedBonus
-
getKnockbackBonus
-
getFireAspect
-
getRespiration
-
getDepthStrider
-
getBlockEfficiency
-
getFishingLuckBonus
-
getFishingSpeedBonus
-
getMobLooting
-
hasAquaAffinity
-
hasFrostWalker
-
hasSoulSpeed
-
hasBindingCurse
-
hasVanishingCurse
-
hasSilkTouch
-
getLoyalty
-
getRiptide
-
hasChanneling
-
getRandomItemWith
@Nullable public static Map.Entry<EquipmentSlot,ItemStack> getRandomItemWith(Enchantment p_44907_, LivingEntity p_44908_) -
getRandomItemWith
@Nullable public static Map.Entry<EquipmentSlot,ItemStack> getRandomItemWith(Enchantment p_44840_, LivingEntity p_44841_, Predicate<ItemStack> p_44842_) -
getEnchantmentCost
public static int getEnchantmentCost(RandomSource p_220288_, int p_220289_, int p_220290_, ItemStack p_220291_) -
enchantItem
public static ItemStack enchantItem(FeatureFlagSet p_329514_, RandomSource p_220293_, ItemStack p_220294_, int p_220295_, boolean p_220296_) -
selectEnchantment
public static List<EnchantmentInstance> selectEnchantment(FeatureFlagSet p_329284_, RandomSource p_220298_, ItemStack p_220299_, int p_220300_, boolean p_220301_) -
filterCompatibleEnchantments
public static void filterCompatibleEnchantments(List<EnchantmentInstance> p_44863_, EnchantmentInstance p_44864_) -
isEnchantmentCompatible
public static boolean isEnchantmentCompatible(Collection<Holder<Enchantment>> p_44860_, Enchantment p_44861_) -
getAvailableEnchantmentResults
public static List<EnchantmentInstance> getAvailableEnchantmentResults(FeatureFlagSet p_334102_, int p_44818_, ItemStack p_44819_, boolean p_44820_)
-