Skip to Content
⚠ Under Construction
ReferenceC++ APIItemType

endstone::ItemType

Represents an item type.

Functions:

NameDescription
getIdReturn the identifier of this item type.
getKeyReturn the namespaced identifier of this item type.
getMaxDurabilityGets the maximum durability of this item type.
getMaxStackSizeGets the maximum amount of this item type that can be held in a stack.
getTranslationKeyGet the translation key, suitable for use in a translation component.

Functions:

NameDescription
getAttempts to get the ItemType with the given name.

getId

std::string_view getId() const

Return the identifier of this item type.

Returns:

this item’s identifier

getKey

NamespacedKey getKey() const

Return the namespaced identifier of this item type.

Returns:

this item’s key

getMaxDurability

int getMaxDurability() const

Gets the maximum durability of this item type.

Returns:

Maximum durability for this item type

getMaxStackSize

int getMaxStackSize() const

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

Returns:

Maximum stack size for this item type

getTranslationKey

std::string getTranslationKey() const

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

Returns:

the translation key

get

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

Attempts to get the ItemType with the given 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

Last updated on