22 enum class Activation :
int {
30 enum class CompatibilityID :
int {
40 enum class Frequency :
int {
47 enum class Type : uchar {
52 ProjectileProtection = 4,
59 BaneOfArthropods = 11,
76 CurseOfVanishing = 28,
91 InvalidEnchantment = 43,
94 enum class VillagerTrading :
int {
99 using Slot = ::SharedTypes::EnchantSlot;
104 ::ll::TypedStorage<1, 1, ::Enchant::Type const> mEnchantType;
105 ::ll::TypedStorage<4, 4, ::Enchant::Frequency const> mFrequency;
106 ::ll::TypedStorage<1, 1, bool const> mIsAvailableInVillagerTrading;
107 ::ll::TypedStorage<4, 4, int const> mPrimarySlots;
108 ::ll::TypedStorage<4, 4, int const> mSecondarySlots;
109 ::ll::TypedStorage<4, 4, int const> mCompatibility;
110 ::ll::TypedStorage<8, 32, ::std::string const> mDescription;
111 ::ll::TypedStorage<8, 48, ::HashedString const> mStringId;
112 ::ll::TypedStorage<8, 48, ::HashedString const> mScriptStringId;
113 ::ll::TypedStorage<1, 1, bool> mIsDisabled;
123 virtual ~Enchant() =
default;
125 virtual bool isCompatibleWith(::Enchant::Type type)
const;
127 virtual int getMinCost(
int level)
const;
129 virtual int getMaxCost(
int level)
const;
131 virtual int getMinLevel()
const;
133 virtual int getMaxLevel()
const;
137 virtual float getAfterBreachArmorFraction(
int,
float)
const;
139 virtual float getDamageBonus(
int,
::Actor const&,
::Actor const&)
const;
141 virtual void doPostAttack(
::Actor& attacker,
::Actor& victim,
int level)
const;
143 virtual void doPostPiercingAttack(
::Actor& attacker,
int enchantLevel)
const;
149 virtual bool isMeleeDamageEnchant()
const;
151 virtual bool isProtectionEnchant()
const;
153 virtual bool isTreasureOnly()
const;
155 virtual bool isDiscoverable()
const;
157 virtual bool _isValidEnchantmentTypeForCategory(::Enchant::Type type)
const;
164 ::Enchant::Type type,
165 ::Enchant::Frequency frequency,
166 ::std::string_view
const stringId,
167 ::std::string_view
const scriptStringId,
168 ::std::string_view
const description,
169 ::Enchant::VillagerTrading isAvailableForVillagerTraining,
174 MCAPI ::std::string getDescriptionId()
const;
180 MCAPI static ::SharedTypes::EnchantSlot enchantSlotFromString(::std::string_view str);
182 MCAPI static ::Enchant
const* getEnchantFromName(
::HashedString const& name);
184 MCAPI static ::Enchant::Type getEnchantTypeFromName(
::HashedString const& name);
188 MCAPI static ::std::string stringFromEnchantSlot(::SharedTypes::EnchantSlot
const& enchantSlot);
194 MCAPI static ::std::unordered_map<::HashedString, ::Enchant::Type>& mEnchantNameToType();
196 MCAPI static ::std::unordered_map<
197 ::SharedTypes::EnchantSlot,
200 ::std::equal_to<::SharedTypes::EnchantSlot>>&
201 mEnchantSlotTypeEnumToStringMap();
203 MCAPI static ::std::unordered_map<::std::string, ::SharedTypes::EnchantSlot>& mEnchantSlotTypeNameToEnumMap();
205 MCAPI static ::std::vector<::std::unique_ptr<::Enchant>>& mEnchants();
212 ::Enchant::Type type,
213 ::Enchant::Frequency frequency,
214 ::std::string_view
const stringId,
215 ::std::string_view
const scriptStringId,
216 ::std::string_view
const description,
217 ::Enchant::VillagerTrading isAvailableForVillagerTraining,
226 MCAPI
bool $isCompatibleWith(::Enchant::Type type)
const;
228 MCAPI
int $getMinCost(
int level)
const;
230 MCAPI
int $getMaxCost(
int level)
const;
232 MCFOLD
int $getMinLevel()
const;
234 MCFOLD
int $getMaxLevel()
const;
238 MCFOLD
float $getAfterBreachArmorFraction(
int,
float)
const;
240 MCFOLD
float $getDamageBonus(
int,
::Actor const&,
::Actor const&)
const;
242 MCFOLD
void $doPostAttack(
::Actor& attacker,
::Actor& victim,
int level)
const;
244 MCFOLD
void $doPostPiercingAttack(
::Actor& attacker,
int enchantLevel)
const;
250 MCFOLD
bool $isMeleeDamageEnchant()
const;
252 MCFOLD
bool $isProtectionEnchant()
const;
254 MCFOLD
bool $isTreasureOnly()
const;
256 MCFOLD
bool $isDiscoverable()
const;
258 MCFOLD
bool $_isValidEnchantmentTypeForCategory(::Enchant::Type type)
const;