Skip to content

Class endstone::ItemType

ClassList > endstone > ItemType

Represents an item type.

  • #include <endstone/inventory/item_type.h>

Public Functions

Type Name
virtual std::string_view getId () const = 0
Return the identifier of this item type.
virtual NamespacedKey getKey () const = 0
Return the namespaced identifier of this item type.
virtual int getMaxDurability () const = 0
Gets the maximum durability of this item type.
virtual int getMaxStackSize () const = 0
Gets the maximum amount of this item type that can be held in a stack.
virtual std::string_view getTranslationKey () const = 0
Get the translation key, suitable for use in a translation component.
bool operator!= (const std::string_view other) const
bool operator!= (const ItemType & other) const
bool operator== (const std::string_view other) const
bool operator== (const ItemType & other) const
virtual ~ItemType () = default

Public Static Functions

Type Name
const ItemType * get (std::string_view name)
Attempts to get the ItemType with the given name.

Public Functions Documentation

function getId

Return the identifier of this item type.

virtual std::string_view endstone::ItemType::getId () const = 0

Returns:

this item's identifier


function getKey

Return the namespaced identifier of this item type.

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

Returns:

this item's key


function getMaxDurability

Gets the maximum durability of this item type.

virtual int endstone::ItemType::getMaxDurability () const = 0

Returns:

Maximum durability for this item type


function getMaxStackSize

Gets the maximum amount of this item type that can be held in a stack.

virtual int endstone::ItemType::getMaxStackSize () const = 0

Returns:

Maximum stack size for this item type


function getTranslationKey

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

virtual std::string_view endstone::ItemType::getTranslationKey () const = 0

Returns:

the translation key


function operator!=

inline bool endstone::ItemType::operator!= (
    const std::string_view other
) const

function operator!=

inline bool endstone::ItemType::operator!= (
    const ItemType & other
) const

function operator==

inline bool endstone::ItemType::operator== (
    const std::string_view other
) const

function operator==

inline bool endstone::ItemType::operator== (
    const ItemType & other
) const

function ~ItemType

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

Public Static Functions Documentation

function get

Attempts to get the ItemType with the given name.

static inline const ItemType * endstone::ItemType::get (
    std::string_view name
) 

Note:

This is a normal lookup, names must be the precise name.

Parameters:

  • name Name of the item_type to get

Returns:

ItemType if found, or nullptr



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