endstone::Enchantment
Functions:
| Name | Description |
|---|---|
canEnchantItem | Checks if this Enchantment may be applied to the given ItemStack . |
conflictsWith | Check if this enchantment conflicts with another enchantment. |
getKey | Return the namespaced identifier for this enchantment. |
getMaxLevel | Gets the maximum level that this Enchantment may become. |
getStartLevel | Gets the level that this Enchantment should start at (also known as minimum level). |
getTranslationKey | Get the translation key, suitable for use in a translation component. |
canEnchantItem
bool canEnchantItem(const ItemStack &item) constChecks 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:
itemItem to test
Returns:
True if the enchantment may be applied, otherwise False
conflictsWith
bool conflictsWith(const Enchantment &other) constCheck if this enchantment conflicts with another enchantment.
Parameters:
otherThe enchantment to check against
Returns:
True if there is a conflict.
getKey
NamespacedKey getKey() constReturn the namespaced identifier for this enchantment.
Returns:
this enchantment’s key
getMaxLevel
int getMaxLevel() constGets the maximum level that this Enchantment may become.
Returns:
Maximum level of the Enchantment
getStartLevel
int getStartLevel() constGets the level that this Enchantment should start at (also known as minimum level).
Returns:
Starting level of the Enchantment
getTranslationKey
std::string getTranslationKey() constGet the translation key, suitable for use in a translation component.
Returns:
the translation key
Last updated on