You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tianyi Ma edited this page Jul 27, 2017
·
6 revisions
A unique object with attributes that represents an object that can interact with inventories, character equipment, and other ItemContainers.
Item Script Usage Example
// Registering an attribute presetvarHashMap=Java.type('java.util.HashMap');varItemFactory=Java.type('com.worldstone.worldengine.game.item.ItemFactory');varpresetMap=newHashMap();presetMap.put('name','my_item');presetMap.put('display_name','My Item');ItemFactory.registerPreset('my_item_preset',presetMap);// Getting an Item instance with an attribute presetvarItemType=Java.type('com.worldstone.worldengine.game.item.ItemFactory.ItemType');varmyItemInstance=ItemFactory.getItem(ItemType.BORING,'my_item_preset');