endstone::Item
Represents a base actor in the level.
Bases: endstone::Actor
Functions:
| Name | Description |
|---|---|
getItemStack | Gets the item stack associated with this item drop. |
getPickupDelay | Gets the delay before this Item is available to be picked up by players. |
getThrower | Get the thrower of this item. |
isUnlimitedLifetime | Gets if this Item lives forever. |
setItemStack | Sets the item stack associated with this item drop. |
setPickupDelay | Sets the delay before this Item is available to be picked up by players. |
setThrower | Set the thrower of this item. |
setUnlimitedLifetime | Sets if this Item should live forever. |
getItemStack
std::unique_ptr<ItemStack> getItemStack() constGets the item stack associated with this item drop.
Returns:
An item stack.
getPickupDelay
int getPickupDelay() constGets the delay before this Item is available to be picked up by players.
Returns:
Remaining delay
getThrower
std::optional<std::int64_t> getThrower() constGet the thrower of this item.
Note:
The thrower is the entity which dropped the item.
Returns:
unique id of thrower
isUnlimitedLifetime
bool isUnlimitedLifetime() constGets 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:
stackAn item stack.
setPickupDelay
void setPickupDelay(int delay)Sets the delay before this Item is available to be picked up by players.
Parameters:
delayNew 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:
throwerunique id of thrower
setUnlimitedLifetime
void setUnlimitedLifetime(bool unlimited)Sets if this Item should live forever.
Parameters:
unlimitedtrue if the lifetime is unlimited
Last updated on