Feeder Helper Component

From wiki
Jump to: navigation, search

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 Feeder Helper Component, signified by the following;

"feederHelper": {
  =Content=
}

Feeder Helper Components are used to specify items that can turn Feeder Tiles into Feeder Tiles with food. This component basically only has the information to fill feeder tiles. This component also complements the Feeder Component, which provides information on creating feeders.

When and How to use

Feeder Helper Component is used whenever you want to make a item that can fill feeders. Specifically, most animal food items should have this property

To start off with first, you will need to create an Item. Once that is done, you can add the following below the last property of the file;

"feederHelper": {
  "canReplace": [
    {
      "from": "staxel.tileObject.animalFurniture.SlopTroughEmpty",
      "to": "staxel.tileObject.animalFurniture.SlopTroughFeed"
    }
  ],
  "feedAmount": 8,
  "replaceSound" : "staxel.sound.whatever"
},

"canReplace" contains a list of blobs which have two properties. "from" is the Tile to check for, "to" is the tile to change to. "feedAmount" is how much food this will add to the feeder. "replaceSound" is the Sound to play when filling the feeder.

With that, this component is complete. You may want to also look into Feeder Component for making the feeder.


Config Options

All config options must be inside the body of;

"feederHelper": {
  =Config Here=
}

"canReplace"

This is a List of Blobs that contain exactly two properties. This property can often look like;

"canReplace": [
  {
    "from": "staxel.tileObject.animalFurniture.SlopTroughEmpty",
    "to": "staxel.tileObject.animalFurniture.SlopTroughFeed"
  },
  {
    "from": "staxel.tileObject.animalFurniture.SlopTroughEmpty",
    "to": "staxel.tileObject.animalFurniture.SlopTroughFeed"
  }
]

"from" is the Tile code to check for.

"to" is the Tile code for the tile to switch to.


"feedAmount"

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 food to add to the tile when it is spawned.


"replaceSound"

Valid options (String): A string containing the code to a Sound.

Default Value: If not specified, will not play any sound.


This specifies a sound to play when switching the tiles around.