Item
Items can be created from lua code in Global Scripts or from json files in the items folder.
Folder Structure
Items can be written in a json file. Items must be under the "items" folder of your mod.
Folder Structure
AppData └── LocalLow └─── Bitten Toast Games └─── GardenPaws └─── Mods └─── Your_Mod_Folder └──── items └─── Your_Item_File.json
Json Example
Here's what an item's json file would look like.
{
"itemtype" : "misc",
"id" : "ItemID",
"name" : "Item Name",
"desc" : "Item Description",
"icon" : "IconFile",
"buy" : 1000,
"sell" : 500,
"stacksTo" : 90,
"clothTemplate" : "ClothingPrefabName",
"vTemplate" : "VisualPrefabName",
"pickTemplate" : "PickupPrefabName",
"visualBind" : "none",
"requires": "EventIDRequired",
"usableType" : "CodeToRunWhenSelected",
"usableVars" : "{'param' = 'SerializedJsonSringWithParameters'}",
"hasGlitter" : false,
"alwaysLoad" : false,
"shoppable" : false,
"chestAvailable" : false,
"autoFurniture" : {
"model" : "modelName",
"category" : "Furniture",
"modelLocalPos" : "{0.0, 0.0, 0.0}",
"modelLocalRot" : "{0.0, 0.0, 0.0}",
"modelLocalScale" : "{1.0, 1.0, 1.0}",
"texture" : "modelTexture"
},
"autoClothing" : {
"model" : "modelName",
"modelLocalPos" : "{0.0, 0.0, 0.0}",
"modelLocalRot" : "{0.0, 0.0, 0.0}",
"modelLocalScale" : "{1.0, 1.0, 1.0}",
"texture" : "modelTexture",
"followPosition" : true,
"followRotation" : true
}
}
Json parameter descriptions.
Parameter | Type | Description |
---|---|---|
id | string |
The ID for this item. Make sure to make it unique so it doesn't conflict with other mods or existing in-game item. This ID can't have spaces. It will be used to call this item from other quests/mail/recipes etc. |
name | string |
Item name |
desc | string |
Description of the Item |
itemtype | specific string |
Type of item, must be one of our specific list of types. Otherwise will be set to 'Misc'. |
icon | string |
Item's Icon name (Without file extension). Place the file in the icons folder of the mod. |
buy | number |
Price you can buy this item (If it's purchaseable somewhere) |
sell | number |
Price this item sells for |
stacksTo | number |
Maximum stack for this item |
sell | number |
Price this item sells for |
stacksTo | number |
Maximum stack for this item |
vTemplate | string |
The entity template that will be used if the player is displaying this item (like a pet on a stone paw) or holding it on the hotbar (like a tool on a player's hand.) |
pickTemplate | string |
The entity template that will be used if an animal drops this item or if it gets spawned by an object spawner. If one is not available it will spawn an icon. |
visualBind | specific string |
If this item has a clothing template or a visual template, to which area of the character does this item bind to. |
usableType | specific string |
If this item is meant to do something when being held in the hotbar it needs to specify what set of code it will call. In case of custom mod code set it to UsableCustom, otherwise check the Usable Types reference sheet in the documentation. |
usableVars | JSON string |
The usable code sets can take a json string with variable to change how they work. The variables would be written here in json format. For more information on different options check the Usable Types reference sheet in this documentation.. |
hasGlitter | bool |
If this is set to true the icon of the item will be displayed with the glitter shader. |
alwaysLoad | bool |
The game unloads furniture that is too far away to help with performance. For certain furniture that need to run code this doesn't work well so you can set this variable to true for it to be always loaded. |
shoppable | bool |
If this variable is set to true this item can appear in shops. If you try to add this item to a shop without this variable being set to true the item won't show up. |
chestAvailable | bool |
If this variable is set to true this item can appear randomly in loot chests around the world. |