Class EnchantmentHelper
java.lang.Object
net.minecraft.world.item.enchantment.EnchantmentHelper
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static interface
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Map<Enchantment,Integer>
deserializeEnchantments(ListTag p_44883_)
static void
doPostDamageEffects(LivingEntity p_44897_, Entity p_44898_)
static void
doPostHurtEffects(LivingEntity p_44824_, Entity p_44825_)
static ItemStack
enchantItem(Random p_44878_, ItemStack p_44879_, int p_44880_, boolean p_44881_)
static void
filterCompatibleEnchantments(List<EnchantmentInstance> p_44863_, EnchantmentInstance p_44864_)
static List<EnchantmentInstance>
getAvailableEnchantmentResults(int p_44818_, ItemStack p_44819_, boolean p_44820_)
static int
getBlockEfficiency(LivingEntity p_44927_)
static float
getDamageBonus(ItemStack p_44834_, MobType p_44835_)
static int
getDamageProtection(Iterable<ItemStack> p_44857_, DamageSource p_44858_)
static int
getDepthStrider(LivingEntity p_44923_)
static int
getEnchantmentCost(Random p_44873_, int p_44874_, int p_44875_, ItemStack p_44876_)
static ResourceLocation
getEnchantmentId(CompoundTag p_182447_)
static ResourceLocation
getEnchantmentId(Enchantment p_182433_)
static int
getEnchantmentLevel(CompoundTag p_182439_)
static int
getEnchantmentLevel(Enchantment p_44837_, LivingEntity p_44838_)
static Map<Enchantment,Integer>
getEnchantments(ItemStack p_44832_)
static int
getFireAspect(LivingEntity p_44915_)
static int
getFishingLuckBonus(ItemStack p_44905_)
static int
getFishingSpeedBonus(ItemStack p_44917_)
static int
getItemEnchantmentLevel(Enchantment p_44844_, ItemStack p_44845_)
static int
getKnockbackBonus(LivingEntity p_44895_)
static int
getLoyalty(ItemStack p_44929_)
static int
getMobLooting(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 int
getRespiration(LivingEntity p_44919_)
static int
getRiptide(ItemStack p_44933_)
static float
getSweepingDamageRatio(LivingEntity p_44822_)
static boolean
hasAquaAffinity(LivingEntity p_44935_)
static boolean
hasBindingCurse(ItemStack p_44921_)
static boolean
hasChanneling(ItemStack p_44937_)
static boolean
hasFrostWalker(LivingEntity p_44939_)
static boolean
hasSoulSpeed(LivingEntity p_44943_)
static boolean
hasVanishingCurse(ItemStack p_44925_)
static boolean
isEnchantmentCompatible(Collection<Enchantment> p_44860_, Enchantment p_44861_)
private static void
runIterationOnInventory(EnchantmentHelper.EnchantmentVisitor p_44854_, Iterable<ItemStack> p_44855_)
private static void
runIterationOnItem(EnchantmentHelper.EnchantmentVisitor p_44851_, ItemStack p_44852_)
static List<EnchantmentInstance>
selectEnchantment(Random p_44910_, ItemStack p_44911_, int p_44912_, boolean p_44913_)
static void
setEnchantmentLevel(CompoundTag p_182441_, int p_182442_)
static void
setEnchantments(Map<Enchantment,Integer> p_44866_, ItemStack p_44867_)
static CompoundTag
storeEnchantment(ResourceLocation p_182444_, int p_182445_)
-
Field Details
-
TAG_ENCH_ID
- See Also:
- Constant Field Values
-
TAG_ENCH_LEVEL
- See Also:
- Constant Field Values
-
-
Constructor Details
-
EnchantmentHelper
public EnchantmentHelper()
-
-
Method Details
-
storeEnchantment
-
setEnchantmentLevel
-
getEnchantmentLevel
-
getEnchantmentId
-
getEnchantmentId
-
getItemEnchantmentLevel
-
getEnchantments
-
deserializeEnchantments
-
setEnchantments
-
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
-
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<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
-
enchantItem
-
selectEnchantment
public static List<EnchantmentInstance> selectEnchantment(Random p_44910_, ItemStack p_44911_, int p_44912_, boolean p_44913_) -
filterCompatibleEnchantments
public static void filterCompatibleEnchantments(List<EnchantmentInstance> p_44863_, EnchantmentInstance p_44864_) -
isEnchantmentCompatible
public static boolean isEnchantmentCompatible(Collection<Enchantment> p_44860_, Enchantment p_44861_) -
getAvailableEnchantmentResults
public static List<EnchantmentInstance> getAvailableEnchantmentResults(int p_44818_, ItemStack p_44819_, boolean p_44820_)
-