Metatable:Item - RodrigoOt/forgottenserver GitHub Wiki

No description available at the moment. ###Available methods: clone()
decay()
getActionId()
getArticle()
getAttribute(key)
getCharges()
getCount()
getDescription(distance)
getFluidType()
getId()
getName()
getParent()
getPluralName()
getPosition()
getSubType()
getTile()
getTopParent()
getType()
getUniqueId()
getWeight()
hasAttribute(key)
hasProperty(property)
isContainer()
isCreature()
isItem()
isPlayer()
isTeleport()
isTile()
[moveTo(position or cylinder)](#moveTo{position or cylinder})
[remove([count = -1])](#remove{[count = -1]})
removeAttribute(key)
setActionId(actionId)
[setAttribute(key, value)](#setAttribute{key, value})
[split([count = 1])](#split{[count = 1]})
[transform(itemId[, count/subType = -1])](#transform{itemId[, count/subType = -1]})


###### clone() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:clone() ``` > **Added in version:** 1.0
###### decay() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:decay() ``` > **Added in version:** 1.0
###### getActionId() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getActionId() ``` > **Added in version:** 1.0
###### getArticle() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getArticle() ``` > **Added in version:** 1.0
###### getAttribute(key) > **Description:** N/A > **Parameters:**
  • _key_ - _No description_
> **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION) ``` > **Added in version:** 1.0
###### getCharges() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getCharges() ``` > **Added in version:** 1.0
###### getCount() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getCount() ``` > **Added in version:** 1.0
###### getDescription(distance) > **Description:** N/A > **Parameters:**
  • _distance_ - _No description_
> **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getDescription(1) ``` > **Added in version:** 1.0
###### getFluidType() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getFluidType() ``` > **Added in version:** 1.0
###### getId() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getId() ``` > **Added in version:** 1.0
###### getName() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getName() ``` > **Added in version:** 1.0
###### getParent() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getParent() ``` > **Added in version:** 1.0
###### getPluralName() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getPluralName() ``` > **Added in version:** 1.0
###### getPosition() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getPosition() ``` > **Added in version:** 1.0
###### getSubType() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getSubType() ``` > **Added in version:** 1.0
###### getTile() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getTile() ``` > **Added in version:** 1.0
###### getTopParent() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getTopParent() ``` > **Added in version:** 1.0
###### getType() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getType() ``` > **Added in version:** 1.0
###### getUniqueId() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getUniqueId() ``` > **Added in version:** 1.0
###### getWeight() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:getWeight() ``` > **Added in version:** 1.1
###### hasAttribute(key) > **Description:** N/A > **Parameters:**
  • _key_ - _No description_
> **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:hasAttribute(ITEM_ATTRIBUTE_DESCRIPTION) ``` > **Added in version:** 1.1
###### hasProperty(property) > **Description:** N/A > **Parameters:**
  • _property_ - _No description_
> **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:hasProperty(unknown) ``` > **Added in version:** 1.0
###### isContainer() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:isContainer() ``` > **Added in version:** 1.0
###### isCreature() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:isCreature() ``` > **Added in version:** 1.0
###### isItem() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:isItem() ``` > **Added in version:** 1.0
###### isPlayer() > **Description:** N/A > **Parameters:** None > **Returns:** false > **Example:** ```Lua local item = Item(...) item:isPlayer() ``` > **Added in version:** 1.1
###### isTeleport() > **Description:** N/A > **Parameters:** None > **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:isTeleport() ``` > **Added in version:** 1.0
###### isTile() > **Description:** N/A > **Parameters:** None > **Returns:** false > **Example:** ```Lua local item = Item(...) item:isTile() ``` > **Added in version:** 1.1
###### moveTo(position or cylinder) > **Description:** N/A > **Parameters:**
  • _position or cylinder_ - _Supported cylinders are: Container, Player and Tile._
> **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:moveTo(Position()) ``` > **Added in version:** 1.0 (only position), extended with support for cylinders in 1.1
###### remove([count = -1]) > **Description:** N/A > **Parameters:**
  • _count_ - _(optional, default: -1)_
> **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:remove(-1) ``` > **Added in version:** 1.0
###### removeAttribute(key) > **Description:** N/A > **Parameters:**
  • _key_ - _No description_
> **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:removeAttribute(ITEM_ATTRIBUTE_DESCRIPTION) ``` > **Added in version:** 1.0
###### setActionId(actionId) > **Description:** N/A > **Parameters:**
  • _actionId_ - _No description_
> **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:setActionId(1000) ``` > **Added in version:** 1.0
###### setAttribute(key, value) > **Description:** N/A > **Parameters:**
  • _key_ - _No description_
  • _value_ - _No description_
> **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, any_string) ``` > **Added in version:** 1.0
###### split([count = 1]) > **Description:** N/A > **Parameters:**
  • _count_ - _(optional, default: 1)_
> **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:split(1) ``` > **Added in version:** 1.0
###### transform(itemId[, count/subType = -1]) > **Description:** N/A > **Parameters:**
  • _itemId_ - _No description_
  • _count/subType_ - _(optional, default: -1)_
> **Returns:** N/A > **Example:** ```Lua local item = Item(...) item:transform(2400, -1) ``` > **Added in version:** 1.0
⚠️ **GitHub.com Fallback** ⚠️