Difference between revisions of "Collect Items Component"
DeamonHunter (Talk | contribs) (Initial commit.) |
DeamonHunter (Talk | contribs) (Update formatting.) |
||
Line 2: | Line 2: | ||
[[:Category:Component Modding]] are all optional properties that can be added to any file. Components are useful in extending the original files with even more information, such as the cost of the item or whether the block can be broken by a weapon. | [[:Category:Component Modding]] are all optional properties that can be added to any file. Components are useful in extending the original files with even more information, such as the cost of the item or whether the block can be broken by a weapon. | ||
− | On this page, we go over the Collect Items | + | On this page, we go over the Collect Items Component, signified by the following; |
<pre> | <pre> | ||
"collectItems": { | "collectItems": { | ||
Line 8: | Line 8: | ||
} | } | ||
</pre> | </pre> | ||
− | Collect Items | + | Collect Items Components are one of the components that are related to [[Achievements]]. This component is similar to the [[Any Of Category Component]]. The difference is this is Whenever you collect or discard items it will check to see if items are in your inventory. |
= When and How to use = | = When and How to use = | ||
− | Collect Items | + | Collect Items Components are used whenever you want an [[Achievements|Achievement]] that tracks the number of specific items in your inventory. |
To start off with first, you should create an [[Achievements|Achievement]]. Once that is done, you can add the following below the last property of the file; | To start off with first, you should create an [[Achievements|Achievement]]. Once that is done, you can add the following below the last property of the file; | ||
Line 45: | Line 45: | ||
== "items" == | == "items" == | ||
− | '''Valid options (List of | + | '''Valid options ([[Modding_Key_Terms#List|List]] of [[Modding_Key_Terms#Blob|Blobs]]): <code>A list of blobs containing [[Items]]. See [[Items#Universal Spawning Rules]] for more details.</code>''' |
'''Default Value:''' No default value is specified. Always need to provide your own. | '''Default Value:''' No default value is specified. Always need to provide your own. | ||
Line 53: | Line 53: | ||
== "type" == | == "type" == | ||
− | '''Valid options (String): <code>"collectItems", "placeItems", "craftItems"</code>''' | + | '''Valid options ([[Modding_Key_Terms#String|String]]): <code>"collectItems", "placeItems", "craftItems"</code>''' |
'''Default Value:''' No default value is specified. Always need to provide your own. | '''Default Value:''' No default value is specified. Always need to provide your own. |
Revision as of 23:59, 20 November 2017
Category:Component Modding are all optional properties that can be added to any file. Components are useful in extending the original files with even more information, such as the cost of the item or whether the block can be broken by a weapon.
On this page, we go over the Collect Items Component, signified by the following;
"collectItems": { =Content= }
Collect Items Components are one of the components that are related to Achievements. This component is similar to the Any Of Category Component. The difference is this is Whenever you collect or discard items it will check to see if items are in your inventory.
When and How to use
Collect Items Components are used whenever you want an Achievement that tracks the number of specific items in your inventory.
To start off with first, you should create an Achievement. Once that is done, you can add the following below the last property of the file;
"collectItems" : { "type" : "craftItems", "items" : [ { "kind" : "staxel.item.CraftItem", "code": "staxel.item.crafting.CakePlain", }, { "kind" : "staxel.item.CraftItem", "code": "staxel.item.crafting.CakeCarrot", }, { "kind" : "staxel.item.CraftItem", "code": "staxel.item.crafting.CakeChocolate", } ] }
This only has two properties. The first is "type", this is one of three different things. "collectItems", "placeItems", and "craftItems". Each of these are a specific action that must be taken in order to count. The second property, "items", is a list of Spawned Items. For more info see Items#Universal Spawning Rules.
Config Options
All config options must be inside the body of;
"collectItems": { =Config Here= }
"items"
Valid options (List of Blobs): A list of blobs containing Items. See Items#Universal Spawning Rules for more details.
Default Value: No default value is specified. Always need to provide your own.
This is the item that will be spawned in. These items must have an extra property which is listed below.
"type"
Valid options (String): "collectItems", "placeItems", "craftItems"
Default Value: No default value is specified. Always need to provide your own.
This is the type of collection required. Each type was specified in the bullet points at the start of this page but are fairly self-explanatory.