Difference between revisions of "Spawn On Break Component"
DeamonHunter (Talk | contribs) m (Updated to new section) |
DeamonHunter (Talk | contribs) (Update Page.) |
||
Line 54: | Line 54: | ||
=== "entires" === | === "entires" === | ||
− | '''Valid options (List of Spawn Item): <code>See [[Items#How to Spawn an Item]] for more information</code>''' | + | '''Valid options ([[Modding_Key_Terms#List|List]] of Spawn Item): <code>See [[Items#How to Spawn an Item]] for more information</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. | ||
+ | |||
These are the items that it will spawn when breaking. | These are the items that it will spawn when breaking. | ||
Line 62: | Line 63: | ||
== "selfDropChance" == | == "selfDropChance" == | ||
− | '''Valid options (Float): <code>A positive decimal number between 0 and 1.</code>''' | + | '''Valid options ([[Modding_Key_Terms#Float|Float]]): <code>A positive decimal number between 0 and 1.</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. | ||
+ | |||
This is the chance that the tile will spawn itself when broken. | This is the chance that the tile will spawn itself when broken. |
Latest revision as of 05:59, 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 Spawn On Break component, signified by the following;
"spawnOnBreak": { =Content= },
Spawn On Break components do exactly what they say on the tin. They define stuff to be spawned when the tile is broken.
When and How to use
Spawn On Break components should be used on any tile that you want to give something to the player for. This is commonly already solved in configs.
To create this component you would use the following;
"spawnOnBreak": { "drops": { "entries": [ { "tile": "staxel.tileObject.animalFurniture.ChickenFeedAreaEmpty", "kind": "staxel.item.Placer" } ] }, "selfDropChance": 0.0 }
"selfDropChance" is the chance between 0 and 1 that the tile will drop itself. "drops" contains only a single property "entries". Entries is a list of items to be spawned upon breaking. See Items#How to Spawn an Item for more information on how to spawn items.
Config Options
All config options must be inside the body of;
"spawnOnBreak": { =Config Here= }
"drops"
This property contains only a single property itself. It will usually look like;
"drops": { "entries": [ { "tile": "staxel.tileObject.animalFurniture.ChickenFeedAreaEmpty", "kind": "staxel.item.Placer" } ] },
"entires"
Valid options (List of Spawn Item): See Items#How to Spawn an Item for more information
Default Value: No default value is specified. Always need to provide your own.
These are the items that it will spawn when breaking.
"selfDropChance"
Valid options (Float): A positive decimal number between 0 and 1.
Default Value: No default value is specified. Always need to provide your own.
This is the chance that the tile will spawn itself when broken.