Difference between revisions of "Own Items Component"
DeamonHunter (Talk | contribs) m (Fix missing <pre> tags.) |
DeamonHunter (Talk | contribs) (Update Page.) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 25: | Line 25: | ||
</pre> | </pre> | ||
− | This only has one property "items" which is a list of blobs. This is not a spawned item blob, but a selection of blobs which contain two properties. The first property is "code", which points to an [[Items]] code. The second is "count". This specifies how many of this item must exist in the inventory. | + | This only has one property [[#"items"]] which is a list of blobs. This is not a spawned item blob, but a selection of blobs which contain two properties. The first property is [[#"code"]], which points to an [[Items]] code. The second is [[#"count"]]. This specifies how many of this item must exist in the inventory. |
= Config Options = | = Config Options = | ||
All config options must be inside the body of; | All config options must be inside the body of; | ||
<pre> | <pre> | ||
− | " | + | "ownItems": { |
=Config Here= | =Config Here= | ||
} | } | ||
Line 36: | Line 36: | ||
− | + | == "items" == | |
This is a list of blobs that contain two properties. This will commonly look like; | This is a list of blobs that contain two properties. This will commonly look like; | ||
<pre> | <pre> | ||
− | " | + | "items": [ |
{ | { | ||
"code" : "staxel.item.whatever", | "code" : "staxel.item.whatever", | ||
Line 51: | Line 51: | ||
=== "code" === | === "code" === | ||
− | '''Valid options (String): <code>A string that contains an [[Items|Item's]] code.</code>''' | + | '''Valid options ([[Modding_Key_Terms#String|String]]): <code>A string that contains an [[Items|Item's]] code.</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 60: | Line 60: | ||
=== "count" === | === "count" === | ||
− | '''Valid options ( | + | '''Valid options ([[Modding_Key_Terms#Integer|Integer]]): <code>A positive integer number.</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. |
Latest revision as of 05:54, 14 December 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 Own Items component, signified by the following;
"ownItems": { =Content= }
Own 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
Own 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;
"ownsItems" : { "items" : [ { "code" : "staxel.item.whatever", "count" : 1 } ] }
This only has one property #"items" which is a list of blobs. This is not a spawned item blob, but a selection of blobs which contain two properties. The first property is #"code", which points to an Items code. The second is #"count". This specifies how many of this item must exist in the inventory.
Config Options
All config options must be inside the body of;
"ownItems": { =Config Here= }
"items"
This is a list of blobs that contain two properties. This will commonly look like;
"items": [ { "code" : "staxel.item.whatever", "count" : 1 }, { =Content= } ]
"code"
Valid options (String): A string that contains an Item's code.
Default Value: No default value is specified. Always need to provide your own.
This is the code of the item you want to check. This will only work on items that have codes, which excludes tiles and clothing.
"count"
Valid options (Integer): A positive integer number.
Default Value: No default value is specified. Always need to provide your own.
This is the amount of this item needed before it is allowed to succeed.