|This Article is up to date with Custom Stuff 2|
Until now, pressure plates were the only way to output a redstone signal using Custom Stuff. The addition of buttons to CS2 adds one more way to output redstone, which will hopefully lead the way for more developments. Until then, here is an example about to make your own custom button.
Example Button (CS2 0.9.10 and above)
config.addBlockIdProperty("cobaltButtonID", 2502); mod.addBlock("cobaltButton.js", "button");
id = config.getBlockId("cobaltButtonID"); name = "cobaltButton"; material = "iron"; stepSound = "metal"; creativeTab = "redstone"; isSensible = false; displayName = "Cobalt Button"; hardness = 1; resistance = 30; textureFileXP = "cobaltBlock.png"; textureFileXN = "cobaltBlock.png"; textureFileYP = "cobaltBlock.png"; textureFileYN = "cobaltBlock.png"; textureFileZP = "cobaltBlock.png"; textureFileZN = "cobaltBlock.png"; addToCreative = true;
Button Block Attributes
textureFile and textureIndex
In CS2 versions for 1.4.7 and below, CS2 0.9.9 or below, textureFile was used to specify the texture sheet and textureIndex was used for identifying the specific icon within the texture sheet. If using CS2 0.9.9 or lower, make sure to use both of these attributes.
This attribute determines if the button can be triggered using arrows. If isSensible is set to false, then the button will act like a stone button. If isSensible is set to true, the button will act like a wooden button.