19 enum class Type : uchar {
24 ProjectileProtection = 4,
31 BaneOfArthropods = 11,
48 CurseOfVanishing = 28,
62 InvalidEnchantment = 42,
65 enum class Frequency :
int {
72 enum class Slot : uint {
87 FishingRod = 1u << 12,
88 CarrotStick = 1u << 13,
93 CosmeticHead = 1u << 18,
95 MushroomStick = 1u << 20,
97 HeavyWeapon = 1u << 22,
98 GArmor = ArmorHead | ArmorTorso | ArmorFeet | ArmorLegs,
99 GDigging = Hoe | Axe | Pickaxe | Shovel,
100 GTool = Hoe | Shears | Flintsteel | Shield,
104 enum class Activation :
int {
112 enum class CompatibilityID :
int {
122 enum class VillagerTrading :
int {
130 ::ll::TypedStorage<1, 1, ::Enchant::Type const> mEnchantType;
131 ::ll::TypedStorage<4, 4, ::Enchant::Frequency const> mFrequency;
132 ::ll::TypedStorage<1, 1, bool const> mIsAvailableInVillagerTrading;
133 ::ll::TypedStorage<4, 4, int const> mPrimarySlots;
134 ::ll::TypedStorage<4, 4, int const> mSecondarySlots;
135 ::ll::TypedStorage<4, 4, int const> mCompatibility;
136 ::ll::TypedStorage<8, 32, ::std::string const> mDescription;
137 ::ll::TypedStorage<8, 48, ::HashedString const> mStringId;
138 ::ll::TypedStorage<8, 48, ::HashedString const> mScriptStringId;
139 ::ll::TypedStorage<1, 1, bool> mIsDisabled;
153 virtual bool isCompatibleWith(::Enchant::Type type)
const;
156 virtual int getMinCost(
int level)
const;
159 virtual int getMaxCost(
int level)
const;
162 virtual int getMinLevel()
const;
165 virtual int getMaxLevel()
const;
171 virtual float getAfterBreachArmorFraction(
int,
float)
const;
174 virtual float getDamageBonus(
int,
::Actor const&,
::Actor const&)
const;
177 virtual void doPostAttack(
::Actor& attacker,
::Actor& victim,
int level)
const;
186 virtual bool isMeleeDamageEnchant()
const;
189 virtual bool isProtectionEnchant()
const;
192 virtual bool isTreasureOnly()
const;
195 virtual bool isDiscoverable()
const;
198 virtual bool _isValidEnchantmentTypeForCategory(::Enchant::Type type)
const;
205 ::Enchant::Type type,
206 ::Enchant::Frequency frequency,
207 ::std::string_view stringId,
208 ::std::string_view scriptStringId,
209 ::std::string_view description,
210 ::Enchant::VillagerTrading isAvailableForVillagerTraining,
219 MCAPI static ::Enchant::Slot enchantSlotFromString(::std::string_view str);
221 MCAPI
static void initEnchants();
223 MCAPI static ::std::string stringFromEnchantSlot(::Enchant::Slot
const& enchantSlot);
229 MCAPI static ::std::unordered_map<::HashedString, ::Enchant::Type>& mEnchantNameToType();
232 unordered_map<::Enchant::Slot, ::std::string, ::EnchantSlotEnumHasher, ::std::equal_to<::Enchant::Slot>>&
233 mEnchantSlotTypeEnumToStringMap();
235 MCAPI static ::std::unordered_map<::std::string, ::Enchant::Slot>& mEnchantSlotTypeNameToEnumMap();
237 MCAPI static ::std::vector<::std::unique_ptr<::Enchant>>& mEnchants();
244 ::Enchant::Type type,
245 ::Enchant::Frequency frequency,
246 ::std::string_view stringId,
247 ::std::string_view scriptStringId,
248 ::std::string_view description,
249 ::Enchant::VillagerTrading isAvailableForVillagerTraining,
264 MCAPI
bool $isCompatibleWith(::Enchant::Type type)
const;
266 MCAPI
int $getMinCost(
int level)
const;
268 MCAPI
int $getMaxCost(
int level)
const;
270 MCFOLD
int $getMinLevel()
const;
272 MCFOLD
int $getMaxLevel()
const;
276 MCFOLD
float $getAfterBreachArmorFraction(
int,
float)
const;
278 MCFOLD
float $getDamageBonus(
int,
::Actor const&,
::Actor const&)
const;
280 MCFOLD
void $doPostAttack(
::Actor& attacker,
::Actor& victim,
int level)
const;
286 MCFOLD
bool $isMeleeDamageEnchant()
const;
288 MCFOLD
bool $isProtectionEnchant()
const;
290 MCFOLD
bool $isTreasureOnly()
const;
292 MCFOLD
bool $isDiscoverable()
const;
294 MCFOLD
bool $_isValidEnchantmentTypeForCategory(::Enchant::Type type)
const;