Skip to content

Class endstone::ItemType

ClassList > endstone > ItemType

Inherits the following classes: endstone::Registry::Type

Public Types inherited from endstone::Registry::Type

See endstone::Registry::Type

Type Name
typedef Identifier< T > Id

Public Static Attributes

Type Name
constexpr auto Air = ItemTypeId::minecraft("air")

Public Functions

Type Name
virtual ItemStack createItemStack () const = 0
Constructs a new ItemStack with this item type that has the amount 1.
virtual ItemStack createItemStack (int amount) const = 0
Constructs a new ItemStack with 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 getTranslationKey () override const = 0
Get the translation key, suitable for use in a translation component.
virtual std::string getTranslationKey (int data) const = 0
Get the translation key, suitable for use in a translation component.

Public Functions inherited from endstone::Registry::Type

See endstone::Registry::Type

Type Name
virtual Id getId () const = 0
Return the identifier of this object.
virtual std::string getTranslationKey () const = 0
Get the translation key, suitable for use in a translation component.
operator Id () const
bool operator!= (const Id & other) const
bool operator!= (const T & other) const
bool operator== (const Id & other) const
bool operator== (const T & other) const
virtual ~Type () = default

Public Static Functions inherited from endstone::Registry::Type

See endstone::Registry::Type

Type Name
const T * get (Id id)
Look up a registry entry by identifier.

Public Static Attributes Documentation

variable Air

constexpr auto endstone::ItemType::Air;

Public Functions Documentation

function createItemStack [½]

Constructs a new ItemStack with this item type that has the amount 1.

virtual ItemStack endstone::ItemType::createItemStack () const = 0

Returns:

the constructed item stack.


function createItemStack [2/2]

Constructs a new ItemStack with this item type.

virtual ItemStack endstone::ItemType::createItemStack (
    int amount
) const = 0

Parameters:

  • amount the amount in the stack

Returns:

An ItemStack of this item type


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 endstone::ItemType::getTranslationKey () override const = 0

Returns:

the translation key

Implements endstone::Registry::Type::getTranslationKey


function getTranslationKey [2/2]

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

virtual std::string endstone::ItemType::getTranslationKey (
    int data
) const = 0

Parameters:

  • data Data for this item type

Returns:

the translation key



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