Skip to Content
⚠ Under Construction
ReferenceC++ APIEnchantment

endstone::Enchantment

Functions:

NameDescription
canEnchantItemChecks if this Enchantment may be applied to the given ItemStack .
conflictsWithCheck if this enchantment conflicts with another enchantment.
getKeyReturn the namespaced identifier for this enchantment.
getMaxLevelGets the maximum level that this Enchantment may become.
getStartLevelGets the level that this Enchantment should start at (also known as minimum level).
getTranslationKeyGet the translation key, suitable for use in a translation component.

canEnchantItem

bool canEnchantItem(const ItemStack &item) const

Checks if this Enchantment may be applied to the given ItemStack .

This does not check if it conflicts with any enchantments already applied to the item.

Parameters:

Returns:

True if the enchantment may be applied, otherwise False

conflictsWith

bool conflictsWith(const Enchantment &other) const

Check if this enchantment conflicts with another enchantment.

Parameters:

  • other The enchantment to check against

Returns:

True if there is a conflict.

getKey

NamespacedKey getKey() const

Return the namespaced identifier for this enchantment.

Returns:

this enchantment’s key

getMaxLevel

int getMaxLevel() const

Gets the maximum level that this Enchantment may become.

Returns:

Maximum level of the Enchantment

getStartLevel

int getStartLevel() const

Gets the level that this Enchantment should start at (also known as minimum level).

Returns:

Starting level of the Enchantment

getTranslationKey

std::string getTranslationKey() const

Get the translation key, suitable for use in a translation component.

Returns:

the translation key

Last updated on