Skip to content

Inventory

getInventoryByType function

Syntax:

lua
Inventory|nil getInventoryByType( Actor owner, int|string inventoryType )
IDInventory Type
0Backpack
1Equipment
2ShortcutBar
3Recipes
4PlaceableInventory
5CraftingQueue
6Feats
7Emotes
8CraftingArtisanInventory
9CraftingArtisanRecipeInventory
10SiegeWeaponCounterWeightInventory
11WeaponInventory
12PetInventory
13CraftingIngredientsInventory
14DismantlerInventory
15Spells
16VisualIllusionSource
17VisualIllusionTarget
18VisualIllusionResult
19GolemParts
20Workorders
21Patrons

GetAllItems function

Syntax:

lua
table<Item> Inventory:GetAllItems()

GetItemByIndex function

Syntax:

lua
Item|nil Inventory:GetItemByIndex( int index )

GetItemById function

Syntax:

lua
Item|nil Inventory:GetItemById( int templateId )

HasItem function

Syntax:

lua
bool Inventory:HasItem( int templateId [, int quantity = 1 ] )

CountItems function

Syntax:

lua
int Inventory:CountItems( int templateId )

SpawnItem function

Syntax:

lua
Item, int Inventory:SpawnItem( int templateId )