Avorion Script API Documentation

Inventory

function Inventory()

This is the default constructor of Inventory. No further arguments are required.

Returns

A new instance of Inventory

property bool empty[read-only]
property unsigned int items[read-only]
property unsigned int maxSlots[read-only]
property unsigned int occupiedSlots[read-only]

function unsigned int add(InventoryItem item, var recent)

function unsigned int addAt(InventoryItem item, unsigned int index, unsigned int amount, var recent)

function var addOrDrop(InventoryItem item, var recent)

function unsigned int amount(unsigned int index)

function var clear()

Returns

nothing

function InventoryItem find(unsigned int index)

function table<int, table<unsigned int, InventoryItem>> getItems()

function table<int, table<unsigned int, InventoryItem>> getItemsByType(InventoryItemType type)

function bool hasSlot(InventoryItem item)

function var remove(unsigned int index)

Returns

nothing

function var removeAll(unsigned int index)

Returns

nothing

function var setAmount(unsigned int index, unsigned int amount)

Returns

nothing

function var setItemTags(unsigned int index, bool favorite, bool trash)

Returns

nothing

function bool slotEmpty(unsigned int index)

function InventoryItem take(unsigned int index)

Overview
Home Functions Search
Search:

This is the official documentation for the scripting API of Avorion. This documentation is automatically generated and not necessarily complete. Depending on the context in which functions exist, some documentation such as descriptions, return values or variable names or types may be missing.

Work in Progress. Documentation of Avorion Version: 2.5.7 c8e4beec84f7