Difference between revisions of "Spawn On Break Component"

From wiki
Jump to: navigation, search
(Initial commit.)
(No difference)

Revision as of 02:38, 21 July 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#Universal Spawning Rules 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#Universal Spawning Rules 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.