This Article is up to date with Custom Stuff 2 |
---|
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)
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.
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.