Skip to Content
⚠ Under Construction
ReferenceC++ APIItem

endstone::Item

Represents a base actor in the level.

Bases: endstone::Actor

Functions:

NameDescription
getItemStackGets the item stack associated with this item drop.
getPickupDelayGets the delay before this Item is available to be picked up by players.
getThrowerGet the thrower of this item.
isUnlimitedLifetimeGets if this Item lives forever.
setItemStackSets the item stack associated with this item drop.
setPickupDelaySets the delay before this Item is available to be picked up by players.
setThrowerSet the thrower of this item.
setUnlimitedLifetimeSets if this Item should live forever.

getItemStack

std::unique_ptr<ItemStack> getItemStack() const

Gets the item stack associated with this item drop.

Returns:

An item stack.

getPickupDelay

int getPickupDelay() const

Gets the delay before this Item is available to be picked up by players.

Returns:

Remaining delay

getThrower

std::optional<std::int64_t> getThrower() const

Get the thrower of this item.

Note:

The thrower is the entity which dropped the item.

Returns:

unique id of thrower

isUnlimitedLifetime

bool isUnlimitedLifetime() const

Gets if this Item lives forever.

Returns:

true if the lifetime is unlimited

setItemStack

void setItemStack(const ItemStack &stack)

Sets the item stack associated with this item drop.

Parameters:

  • stack An item stack.

setPickupDelay

void setPickupDelay(int delay)

Sets the delay before this Item is available to be picked up by players.

Parameters:

  • delay New delay

setThrower

void setThrower(std::optional<std::int64_t> thrower)

Set the thrower of this item.

Note:

The thrower is the entity which dropped the item.

Parameters:

  • thrower unique id of thrower

setUnlimitedLifetime

void setUnlimitedLifetime(bool unlimited)

Sets if this Item should live forever.

Parameters:

  • unlimited true if the lifetime is unlimited
Last updated on