Skip to content

Class endstone::Enchantment

ClassList > endstone > Enchantment

Public Functions

Type Name
virtual bool canEnchantItem (const ItemStack & item) const = 0
virtual bool conflictsWith (const Enchantment & other) const = 0
Check if this enchantment conflicts with another enchantment.
virtual NamespacedKey getKey () const = 0
Return the namespaced 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 ~Enchantment () = default

Public Functions Documentation

function canEnchantItem

virtual bool endstone::Enchantment::canEnchantItem (
    const  ItemStack & item
) const = 0

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


function conflictsWith

Check if this enchantment conflicts with another enchantment.

virtual bool endstone::Enchantment::conflictsWith (
    const  Enchantment & other
) const = 0

Parameters:

  • other The enchantment to check against

Returns:

True if there is a conflict.


function getKey

Return the namespaced identifier for this enchantment.

virtual NamespacedKey endstone::Enchantment::getKey () const = 0

Returns:

this enchantment's key


function getMaxLevel

Gets the maximum level that this Enchantment may become.

virtual int endstone::Enchantment::getMaxLevel () const = 0

Returns:

Maximum level of the Enchantment


function getStartLevel

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

virtual int endstone::Enchantment::getStartLevel () const = 0

Returns:

Starting level of the Enchantment


function ~Enchantment

virtual endstone::Enchantment::~Enchantment () = default


The documentation for this class was generated from the following file include/endstone/enchantments/enchantment.h