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() 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