FANDOM


This Article is up to date with Custom Stuff 2 CS2
Fake tree

A non-growing tree for your decorative needs.

The crosstexture block type is a block type that looks similar to tall grass, mushrooms, and flowers. Unlike vanilla crosstexture blocks, custom stuff crosstexture blocks do not have any restrictions for place locations. This means you can even place your custom crosstexture blocks on the ceiling. If you want, you could even make a chandelier with the help of the light attribute.

Crosstexture Block

newCross.js (CS2 v.0.9.10 and later)
2012-10-19 21.32.46

CrossTexture block

id = config.getBlockId("crossID");
name = "CrossBlock";
displayName[0] = "Simple Cross";
material = "plants";
stepSound = "grass";
hardness[0] = 0;
opacity[0] = 0;
drop[0] = config.getBlockId("crossID") + ":0 1";
hasCollision[0] = false;
addToCreative[0] = true;
textureFileYN[0] = "exampleImage.png";

mod.js

config.addBlockIdProperty("crossID", 203);
mod.addBlock("newCross.js", "crossTexture");

Crosstexture Block Attributes

Below is a table of attributes available to crosstexture-type blocks, including information on notable 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.

textureFileYN
Only the Y-Negative texture file is used in the cross texture. The others textureFile attributes can be left blank.

hasCollision
Generally, cross texture style blocks can be walked through. By default, this attribute is set to 'true' making it so that the block cannot be moved through. Most of the time, you will want to set this attribute to "false".

opacity
The default for the Opacity attribute for this block type is set to 0. It is important that it be left this way, otherwise the entire block will be in its own self-imposed shadow at all light levels. For this reason, it is suggested that you do NOT adjust this attribute.

canPlaceOnCeiling, canPlaceOnFloor, and canPlaceOnWall
All of these are by default set to true and do exactly what their name implies. If you want your crossTexture block to only be place-able directly on the ground, make sure to set canPlaceOnCeiling and canPlaceOnWall to false.

CS1
Older Examples and Information for Custom Stuff 1.

Example Crosstexture Block (CS1)

id = 172;
name = "Fake Tree";
texturefile = "terrain.png";
textureindex = 15;
type = "crosstexture";
material = "ground"
stepsound = "grass"
hardness = 0;
opacity = 0;
collision = false;

Crosstexture Block Attributes

Below is a table of attributes available to normal-type blocks, including information on notable attributes.

Required Attributes

Optional Attributes

type
This must be set to 'crosstexture' in order for the block to be of the crosstexture type. Other types that can be used for this attribute can be found on the typeattributepage. opacity
Setting this attribute to a low value prevents a rather pronounced visual bug. See Importance of the Opacity Attribute below.

collision
Set this attribute to 'false' to allow players to walk through your crosstexture block. Leaving this out does not allow the player to stand on the block as if it were a normal solid block.

Movebypiston and Collision

When collision is set to false, the block will be harvested when a piston pushes it, just like a vanilla flower or sugar cane. When it is harvested in this way, it will drop whatever items or blocks are set for the dropped attributes. It does not, however, activate the destroyed event, meaning any extra code kept in the destroyed event is ignored. Also, the movebypiston attribute being set to false does not stop the block from being harvested.

Importance of the Opacity Attribute

Tree comparison

An example of a crosstexture with the default opacity (right) and the correct opacity (left).

When making crosstexture blocks, the opacity attribute should always be set to a value of ten or less even if the the material being used not being intrinsically translucent. This is done to prevent a visual 'bug', demonstrated by the picture at right, which causes a shadow to be cast on adjacent blocks of light level. This 'glitch' occurs because Minecraft calculates the light level of the area 'inside' the block based on what's immediately below it. Because a block normally blocks all light, the boundary of the crosstexture, which for this purpose is the same as a normal-type block, forces the game to calculate the light level as being 0 on the ground beneath the block. Setting the opacity to a low value fixes this issue. This is also why stairs, slabs, and doors in the vanilla game don't block light entirely even when they logically should.

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.