3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/world/item/enchanting/Enchant.h"
7#include "mc/world/item/enchanting/EquipmentFilter.h"
29namespace EnchantUtils {
32MCAPI
void appendEnchantToFormattedText(
34 ::std::string_view enchantName,
35 ::Bedrock::Safety::RedactableString& formattedEnchantmentText
38MCAPI
bool applyEnchant(::ItemStackBase& out, ::EnchantmentInstance
const& enchant,
bool allowNonVanilla);
40MCAPI
bool applyEnchant(::ItemStackBase& out, ::Enchant::Type type,
int level,
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);
50MCAPI ::EnchantResult canEnchant(::ItemStackBase
const& item, ::Enchant::Type type,
int level,
bool allowNonVanilla);
53combineEnchantedItems(::ItemStack
const& first, ::ItemStack
const& second, ::ItemStack& out,
bool bookEnchant);
55MCAPI
void doPostHurtEffects(::Mob& victim, ::Mob& attacker);
57MCAPI
void doPostItemHurtActorEffects(::Actor& victim, ::Actor& attacker, ::ItemEnchants
const& preHurtEnchantments);
59MCAPI
void doPostPiercingAttackEffects(::Actor& attacker);
61MCAPI
void doPreDamageEffects(::Actor& victim, ::Actor& attacker);
63MCAPI ::ItemInstance generateEnchantedBook(::EnchantmentInstance
const& enchant);
65MCAPI ::std::vector<::std::pair<::EnchantmentInstance, int>>
66getAvailableEnchantmentResults(::Item
const* item,
int value,
bool treasure);
68MCAPI ::std::vector<::Vec3> getBookCasePositions(::BlockSource& source, ::Vec3
const& pos);
70MCAPI
void getCurses(::ItemStackBase
const& item, ::std::vector<::EnchantmentInstance>& outputCurses);
72MCAPI
float getDamageReduction(::ActorDamageSource
const& source, ::Mob
const& target);
74MCAPI ::std::vector<int> getEnchantCosts(::ItemStackBase
const& itemInst,
int bookcaseCount);
76MCAPI
int getEnchantLevel(::Enchant::Type enchantType, ::ItemStackBase
const& stack);
78MCAPI ::std::string getEnchantNameAndLevel(::Enchant::Type
id,
int level);
81MCAPI ::std::string getEnchantStringId(::Enchant::Type
id);
84MCAPI ::std::vector<::Vec3> getEnchantingTablePositions(::BlockSource& source, ::Vec3
const& pos);
86MCAPI ::Enchant::Type getEnchantmentId(::HashedString
const& stringId);
88MCAPI ::std::string getLevelString(
int level);
90MCAPI
float getMeleeDamageBonus(::Actor
const& victim, ::Actor
const& attacker);
92MCAPI ::ItemStack
const& getRandomDamagedItemWithMending(::Mob
const& equipped);
94MCAPI ::ItemStack
const& getRandomItemWith(::Enchant::Type type, ::Mob
const& equipped, ::EquipmentFilter filter);
96MCAPI ::std::string getRandomName();
98MCAPI
int getTotalProtectionLevels(::Enchant::Type type, ::Mob
const& target);
100MCAPI
int getTradeableRandomEnchantIndex(::Random& random);
102MCAPI
bool hasCurse(::ItemStackBase
const& item);
104MCAPI
bool hasEnchant(::Enchant::Type enchantType, ::ItemStackBase
const& item);
106MCAPI
bool isCurse(::Enchant::Type enchantType);
108MCFOLD
void randomlyEnchant(::ItemInstance& out,
int cost,
int valueBuff,
bool treasure);
110MCFOLD
void randomlyEnchant(::ItemStack& out,
int cost,
int valueBuff,
bool treasure);
112MCAPI
void removeEnchants(::ItemStack& out);
114MCAPI ::ItemEnchants selectEnchantments(::Item
const* item,
int enchantCost,
int valueBuff,
bool treasure);
Definition ActorDamageSource.h:18
Definition RedactableString.h:10
Definition BlockSource.h:73
Definition EnchantmentInstance.h:8
Definition HashedString.h:5
Definition ItemEnchants.h:15
Definition ItemInstance.h:15
Definition ItemStackBase.h:52
Definition ItemStack.h:35
Definition ActorUniqueID.h:10
Definition EnchantResult.h:8