Class endstone::Enchantment¶
ClassList > endstone > Enchantment
Public Functions¶
| Type | Name | 
|---|---|
| virtual bool | canEnchantItem (const ItemStack & item) const = 0 Checks if this Enchantment may be applied to the givenItemStack . | 
| virtual bool | conflictsWith (const Enchantment & other) const = 0 Check if this enchantment conflicts with another enchantment. | 
| virtual std::string | getId () const = 0 Return the identifier for this enchantment. | 
| virtual int | getMaxLevel () const = 0 Gets the maximum level that this Enchantment may become. | 
| virtual int | getStartLevel () const = 0 Gets the level that this Enchantment should start at (also known as minimum level). | 
| virtual std::string | getTranslationKey () const = 0 Get the translation key, suitable for use in a translation component. | 
| virtual | ~Enchantment () = default | 
Public Static Functions¶
| Type | Name | 
|---|---|
| const Enchantment * | get (const std::string & name) Attempts to get the Enchantment with the given name. | 
Public Functions Documentation¶
function canEnchantItem¶
Checks if this Enchantment may be applied to the givenItemStack .
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
function conflictsWith¶
Check if this enchantment conflicts with another enchantment.
Parameters:
- otherThe enchantment to check against
Returns:
True if there is a conflict.
function getId¶
Return the identifier for this enchantment.
Returns:
this enchantment's id
function getMaxLevel¶
Gets the maximum level that this Enchantment may become.
Returns:
Maximum level of the Enchantment
function getStartLevel¶
Gets the level that this Enchantment should start at (also known as minimum level).
Returns:
Starting level of the Enchantment
function getTranslationKey¶
Get the translation key, suitable for use in a translation component.
Returns:
the translation key
function ~Enchantment¶
Public Static Functions Documentation¶
function get¶
Attempts to get the Enchantment with the given name.
Note:
This is a normal lookup, names must be the precise name.
Parameters:
- nameName of the Enchantment to get
Returns:
ItemType if found, or nullptr
The documentation for this class was generated from the following file include/endstone/enchantments/enchantment.h