FANDOM


This Article is up to date with Custom Stuff 2 CS2
FaerieLights

No cave is dark or gloomy with Faerie Lights lining the walls.

Torches are a block type available in Custom Stuff. As one might expect, this block type mimics the two types of torches that already exist in vanilla Minecraft, at least in so far as their geometry and placement goes. There is presently no way to make a torch emit a Redstone signal (as a vanilla redstone torch does), but light can be emitted using the light attribute.

Torches take up a single block and must be placed either on top of or on the side of a full block (either normal or simple block type). Their geometry consists of four planes that intersect near the middle, creating the illusion of a solid shaft when the center 2x2 pixels are opaque. This makes them both challenging and simple to texture.

Because torches use their damage values to remember their orientation when placed, you cannot use these values to create variations.

Redstone Powered Torch (CS2 0.10.0 and above)

RedstonePoweredTorch

Apply redstone signal for light.

mod.js

config.addBlockIdProperty("cobaltElecTorchID", 2521);
config.addBlockIdProperty("cobaltElecTorchOnID", 2522);
mod.addBlock("cobaltElecTorch.js", "torch");
mod.addBlock("cobaltElecTorchOn.js", "torch");

blocks/cobaltElecTorch.js

id = config.getBlockId("cobaltElecTorchID");
name = "cobaltElecTorch";
material = "iron";
stepSound = "metal";
creativeTab = "buildingBlocks";

displayName[0] = "Electric Cobalt Torch";
canPlaceOnCeiling[0] = false;
canPlaceOnFloor[0] = true;
canPlaceOnWall[0] = true;
hardness[0] = 5;
resistance[0] = 30;
toolClass[0] = "pickaxe";
harvestLevel[0] = 2;
textureFileXP[0] = "cobaltTorchOff.png";
textureFileXN[0] = "cobaltTorchOff.png";
textureFileYP[0] = "cobaltTorchOff.png";
textureFileYN[0] = "cobaltTorchOff.png";
textureFileZP[0] = "cobaltTorchOff.png";
textureFileZN[0] = "cobaltTorchOff.png";
addToCreative[0] = true;
onRedstoneSignal[0] = "if(redstoneSignal==true){world.setBlockIdAndMetadata(position, config.getBlockId('cobaltElecTorchOnID'), world.getBlockMetadata(position));}";

blocks/cobaltElecTorchOn.js

id = config.getBlockId("cobaltElecTorchOnID");
name = "cobaltElecTorchOn";
material = "iron";
stepSound = "metal";
creativeTab = "buildingBlocks";

displayName[0] = "Electric Cobalt Torch";
canPlaceOnCeiling[0] = false;
canPlaceOnFloor[0] = true;
canPlaceOnWall[0] = true;
drop[0] = config.getBlockId("cobaltElecTorchID") + ":0 1";
pick[0] = config.getBlockId("cobaltElecTorchID") + ":0 1";
light[0] = 15;
hardness[0] = 5;
resistance[0] = 30;
toolClass[0] = "pickaxe";
harvestLevel[0] = 2;
textureFileXP[0] = "cobaltTorchOn.png";
textureFileXN[0] = "cobaltTorchOn.png";
textureFileYP[0] = "cobaltTorchOn.png";
textureFileYN[0] = "cobaltTorchOn.png";
textureFileZP[0] = "cobaltTorchOn.png";
textureFileZN[0] = "cobaltTorchOn.png";
addToCreative[0] = false;
onRedstoneSignal[0] = "if(redstoneSignal==false){world.setBlockIdAndMetadata(position, config.getBlockId('cobaltElecTorchID'), world.getBlockMetadata(position));}";

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

light This attribute is what makes your torch give off light. It is set to 0 by default, so make sure to set this value if you want your torch to do more than look good.


CS1
Older Examples and Information for Custom Stuff 1.

Example Torch Block (CS1)

name="Faerie Light";
id=128;
texturefile="CustomStuff.png";
textureindex=2;
type="torch";
material="wood";
stepsound="wood";
hardness=0;
hardness1=0;
hardness2=0;
hardness3=0;
hardness4=0;
hardness5=0;
resistance=0;
harvestlevel=0;
toolclass="pickaxe, axe, shovel, hoe";
iddropped=128;
damagedropped=0;
quantitydropped=1;
opacity=0;
light=14;
collision="false";
addtocreative="true";

Torch Block Attributes (CS1)

Below is a table of attributes available to torch-type blocks, including information on notable attributes. Keep in mind that for some attributes that can be altered with damage values, you must specify that attribute for the first six DVs (0-5) for it to function in all orientations of the torch. This does not seem to apply to all attributes, however. Light, for example, works fine with only the basic value specified while hardness does not.


Required Attributes

Optional Attributes

type
This must be set to 'torch' in order for the block to function as a torch.

opacity
If your torch emits a strong light, there's no reason to set this. Otherwise, this attribute should be set to a low value (preferably 0) to avoid it casting a false shadow.

collision
Although somewhat counter-intuitive, this attribute has to be set in order to prevent torches from remaining solid. Keeping this attribute at 'false' will enforce collision with the torch geometry (which is small enough that you can fit between two torches placed side-by-side) and allow you to stand on top of them. Leaving this as true (default) will also allow them to be successfully moved by pistons unless movebypiston is set to false.

light
As silly as it may seem, torches need not emit light unless the light attribute is set for the torch.

Limitations

  • There is presently no way to override the default behavior of torches, and allow them to be placed in midair or on ceilings.
  • There is presently no way to set up a torch that emits a redstone signal like a redstone torch does.

Bugs

  • UnderwaterFaerieLight

    Placing torches under water is... interesting.

    Torches do not seem to drop anything, even when broken with the proper tool.
  • Likewise, event triggers do not seem to work when placed on torches.
  • Some attributes, like Hardness require that it be specified for all of the first five damage values in order to work. This behavior was previously fixed in fence gates, stairs, ladders and upper part of door.
  • Unlike vanilla torches, Custom Torches are not swept away or destroyed when placed in water or lava.
    • This can be artifically changed by adding a few lines to the block file and adding a script file. Lines starting with // are only to tell where to put the text, please do not copy them into the files. Note: script only checks for water and lava, check the bucket workaround or manually add extra checks to the if statement...
//for the torch's .block file
tickrate = 20;
update = "customstuff.loadScript('floodcheck.script');";

//for the floodcheck.script file
var checkedBlockId;
for(var sideCheck = 0;sideCheck < 6;sideCheck++)
{
	switch(sideCheck)
	{
	case 0:
		origin.y--;
		checkedBlockId = world.getBlockId(origin);
		origin.y++;
		break;
	case 1:
		origin.y++;
		checkedBlockId = world.getBlockId(origin);
		origin.y--;
		break;
	case 2:
		origin.z--;
		checkedBlockId = world.getBlockId(origin);
		origin.z++;
		break;
	case 3:
		origin.z++;
		checkedBlockId = world.getBlockId(origin);
		origin.z--;
		break;
	case 4:
		origin.x--;
		checkedBlockId = world.getBlockId(origin);
		origin.x++;
		break;
	case 5:
		origin.x++;
		checkedBlockId = world.getBlockId(origin);
		origin.x--;
		break;
	}
	if(checkedBlockId == 9 || checkedBlockId == 8 || checkedBlockId == 10 || checkedBlockId == 11)
	{
		world.harvestBlock(origin);
		break;
	}
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.