endstone::ItemType
Represents an item type.
Functions:
Name | Description |
---|---|
getId | Return the identifier of this item type. |
getKey | Return the namespaced identifier of this item type. |
getMaxDurability | Gets the maximum durability of this item type. |
getMaxStackSize | Gets the maximum amount of this item type that can be held in a stack. |
getTranslationKey | Get the translation key, suitable for use in a translation component. |
Functions:
Name | Description |
---|---|
get | Attempts 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