Item Object Documentation
Overview
The Item object in GrowSoft provides global and instance-level access to item data, including name, rarity, type, grow time, and reward values.
Most functions are used with either the global accessor getItem(itemID) or the object method item:getName().
Accessing Item Data
getItem(itemID) -- Returns the global item data object for a given item ID.ℹ️
Global Item Data
The getItem() function provides access to server-wide item properties that apply to all instances of that item.
Item Information
item:getName() -- Returns the item's name.
item:getRarity() -- Returns the item's rarity.
item:getActionType() -- Returns the item's action type (e.g., clothing, seed).
item:getCategoryType() -- Returns the category type of an item.
item:getEditableType() -- Returns the editable type of an item.
item:getNetID() -- Returns the item's net ID.Growth & Behavior
item:getGrowTime() -- Returns the item's grow time in seconds.
item:setGrowTime(seconds) -- Sets the grow time for an item globally.
item:setActionType(type) -- Sets the action type for an item globally.Description & Display
item:setDescription(text) -- Sets the description for an item globally.Item Value & Economy
item:setPrice(price) -- Sets the price of the item.
item:isObtainable() -- Returns true if the item is obtainable.XP & Gem Rewards
item:getGems(world, player) -- Returns the number of gems an item would drop, optionally considering player buffs.
item:getXP(world, player) -- Returns the amount of XP an item would give, optionally considering player buffs.ℹ️
Buff-Aware Calculations
The getGems() and getXP() functions can consider player buffs when calculating rewards!