Items module. Items are described in detail in Items and Bundles article.

Note: Updating items through the editor API ("core/edit.reload" with "core/item.newItems" sub-type) will create new item instances. If you need to have permanent references to item instances, use module subscription "core/item.loadTablesPost" to update them.

Fields

itemGroups:Map<Int, _ItemGroup>

Item groups key-value map. Key is item group ID.

Methods

find (obj:Dynamic):List<ItemProtoClass>

Searches for items with given attributes and returns the list.

Parameters:

obj

Attributes object.

Returns:

A list of items with these attributes set to given values. Returns an empty list if no items were found.

inline getItem (id:Int):ItemProtoClass

Returns item by its ID.

Parameters:

id

Item ID.

Returns:

Item instance. Returns null, if no such item exists.

inline getItemByStringID (sid:String):ItemProtoClass

Returns a single item by its string ID. If multiple items exist with the same string ID, this method returns the first one.

Parameters:

sid

Item string ID.

Returns:

Item instance. Returns null, if no such item exists.

inline getItemsByStringID (sid:String):List<ItemProtoClass>

Returns items list with this string ID.

Parameters:

sid

Item string ID.

Returns:

Items list. Returns null, if no items exist with this string ID.

inline getItemsByType (sid:String):List<ItemProtoClass>

Returns items list with this type string ID.

Parameters:

sid

Item type string ID.

Returns:

Items list. Returns null, if no items exist with this type string ID.

inline iterator ():Iterator<ItemProtoClass>

Returns items list iterator.

Returns:

Items iterator.