Minecraftmodcustomstuff Wiki
Register
Advertisement
CobaltButtonExample

Push it. You know you want to.

This Article is up to date with Custom Stuff 2 "Denotes content compatible with Custom Stuff 2"

Do you get bored of only have 2 kinds of buttons? With the new button block type, you can finally add your own buttons to Minecraft. Unfortunately, there is no way to change the shape and size of the button, but having buttons with different textures that will fit your CS2 houses is still a big improvement over vanilla buttons.

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)[]

mod.js

config.addBlockIdProperty("cobaltButtonID", 2502);
mod.addBlock("cobaltButton.js", "button");

blocks/cobaltButton.js

id = config.getBlockId("cobaltButtonID");
name = "cobaltButton";
material = "iron";
stepSound = "metal";
creativeTab = "redstone";
isSensible = false;

displayName[0] = "Cobalt Button";
hardness[0] = 1;
resistance[0] = 30;
textureFileXP[0] = "cobaltBlock.png";
textureFileXN[0] = "cobaltBlock.png";
textureFileYP[0] = "cobaltBlock.png";
textureFileYN[0] = "cobaltBlock.png";
textureFileZP[0] = "cobaltBlock.png";
textureFileZN[0] = "cobaltBlock.png";
addToCreative[0] = true;

Button Block Attributes[]

Required Attributes

Optional 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.

isSensible
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.

Advertisement