3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/world/item/enchanting/Enchant.h"
7#include "mc/world/item/enchanting/EquipmentFilter.h"
28namespace EnchantUtils {
31LLNDAPI ::std::vector<::std::pair<::EnchantmentInstance, int>>
32getAvailableEnchantmentResults(::Item
const* item,
int value,
bool treasure);
34MCNAPI
void appendEnchantToFormattedText(
36 ::std::string_view enchantName,
37 ::Bedrock::Safety::RedactableString& formattedEnchantmentText
40MCAPI
bool applyEnchant(::ItemStackBase& out, ::EnchantmentInstance
const& enchant,
bool allowNonVanilla);
42MCAPI
int applyEnchant(::ItemStackBase& out, ::ItemEnchants
const& enchants,
bool allowNonVanilla);
45calculateAfterBreachArmorFraction(::ActorUniqueID
const& attackerID, ::Mob
const& target,
float armorFraction);
48canEnchant(::ItemStackBase
const& item, ::EnchantmentInstance
const& enchant,
bool allowNonVanilla);
51combineEnchantedItems(::ItemStack
const& first, ::ItemStack
const& second, ::ItemStack& out,
bool bookEnchant);
53MCNAPI
void doPostHurtEffects(::Mob& victim, ::Mob& attacker);
55MCNAPI
void doPostPiercingAttackEffects(::Actor& attacker);
57MCNAPI
void doPreDamageEffects(::Actor& victim, ::Actor& attacker);
59MCAPI ::std::vector<::Vec3> getBookCasePositions(::BlockSource& source, ::Vec3
const& pos);
61MCNAPI
void getCurses(::ItemStackBase
const& item, ::std::vector<::EnchantmentInstance>& outputCurses);
63MCNAPI
float getDamageReduction(::ActorDamageSource
const& source, ::Mob
const& target);
65MCAPI ::std::vector<int> getEnchantCosts(::IRandom& random, ::ItemStackBase
const& itemInst,
int bookcaseCount);
67MCAPI
int getEnchantLevel(::Enchant::Type enchantType, ::ItemStackBase
const& stack);
69MCAPI ::std::string getEnchantNameAndLevel(::Enchant::Type
id,
int level);
72MCNAPI ::std::string getEnchantStringId(::Enchant::Type
id);
75MCNAPI ::std::vector<::Vec3> getEnchantingTablePositions(::BlockSource& source, ::Vec3
const& pos);
77MCAPI ::Enchant::Type getEnchantmentId(::HashedString
const& stringId);
79MCNAPI
float getMeleeDamageBonus(::Actor
const& victim, ::Actor
const& attacker);
81MCAPI ::ItemStack
const& getRandomDamagedItemWithMending(::IRandom& random, ::Mob
const& equipped);
83MCNAPI ::ItemStack
const& getRandomItemWith(::Enchant::Type type, ::Mob
const& equipped, ::EquipmentFilter filter);
85MCNAPI ::std::string getRandomName(::IRandom& random);
87MCNAPI
int getTotalProtectionLevels(::Enchant::Type type, ::Mob
const& target);
89MCNAPI
int getTradeableRandomEnchantIndex(::IRandom& random);
91MCAPI
bool hasEnchant(::Enchant::Type enchantType, ::ItemStackBase
const& item);
93MCAPI
void randomlyEnchant(::IRandom& random, ::ItemStackBase& out,
int cost,
int valueBuff,
bool treasure);
95MCAPI
void removeEnchants(::ItemStack& out);
98selectEnchantments(::IRandom& random, ::Item
const* item,
int enchantCost,
int valueBuff,
bool treasure);
Definition ActorDamageSource.h:18
Definition RedactableString.h:10
Definition BlockSource.h:72
Definition EnchantmentInstance.h:8
Definition HashedString.h:5
Definition ItemEnchants.h:13
Definition ItemStackBase.h:45
Definition ItemStack.h:26
Definition ActorUniqueID.h:5
Definition EnchantResult.h:8