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) 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:
item
Item to test
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