FANDOM


This Article is up to date with Custom Stuff 2 CS2

The textureFile attribute is not a single attribute, but in fact a series of six attributes cooresponding to the six sides of a block. By specifying each of these with an image file of your choosing, you can add a different texture to each side of the block, or the same texture to every face.

This attribute also works for items, although it is somewhat different in that it cannot be an array attribute and there's only a single file to be specified. That is, you cannot specify a particular metadata or damage value to assign a texture to.

As a Block Attribute

For Blocks, the attribute must be added for each of the six faces of a block. Likewise, this must always be an array attribute, even if only a single metadata value is used.

Most of the time, you will need to specify all six of these attributes to get a texture on all six sides of your block. Some block types, such as crosstexture do not have six distinct faces. In these cases, you need only specify the one direction from which the block takes its textures. This is usually YN or YP.

For most blocks, you add the textureFile attributes to your block's .js file as follows:

textureFileXP[0] = "blockEast.png";
textureFileXN[0] = "blockWest.png";
textureFileYP[0] = "blockTop.png";
textureFileYN[0] = "blockBottom.png";
textureFileZP[0] = "blockSouth.png";
textureFileZN[0] = "blockNorth.png";

Changing the number in the brackets changes the metadata value.

For the texture file itself, you can change where the image is stores although in CS2 0.1.10, this is somewhat limited. By default, a texture is pulled from "/CustomStuff/(project name)/assets/(project name)/textures/blocks/" All block textures must be stored in this folder as individual tiles. This is different from how textures were stored in versions preceeding Minecraft 1.5. Sheets of textures can no longer be used by CustomStuff.

The alternative to this is that textures can be drawn from the default texture folder, which can be found in every version's .jar file: "/assets/minecraft/textures/blocks/" To do this, put a "/" in front of the file name, like so:

textureFile[0] = "/blockIron.png";

In this example, the default iron block texture will be used. Naturally if someone changes this texture with a Resource Pack, your block will automatically be changed as well.

An explanation of the six attributes.

Each of these six attributes is keyed to a particular face of the block. Minecraft, and in fact all 3d games, use a three-axis system to determine object placement. This is a system of coordinates X, Y, and Z. X is the east-west direction, Y is the up-down direction, and Z is the north-south direction.

An easy way to remember which direction is positive and negative is to face South (or pretend you are if you don't know which direction south really is) and hold your right hand vertically so your fingers are pointing strait up. Make a fist, and extend your thumb. This is X-Postive. Extend your index finger strait up. This is Y-Positive. Finally, extend your middle finger in the remaining direction (away from you). This is Z-Positive.

As an Item Attribute

For items, textureFile is a single attribute that determines how the item will look. By making a custom graphic and calling it with this attribute, you can change how your custom-made item will look in-game.

You add this attribute to your item's .js file like so:

textureFile[0] = "itemIcon.png";

By default, all item textures will be called from "/CustomStuff/(project name)/assets/(project name)/textures/items/". The "(project name)" between "assets" and "textures" must be lowercase! All item textures must be stored there, as of CS2 0.10.5. This was due to a change in Minecraft 1.6.2 regarding how textures are stored. As with block textures, each texture must be stored in its own file. Minecraft no longer supports sheets of textures as it did before 1.5.

You can also pull textures from "minecraft.jar/assets/minecraft/textures/items/" by putting a "/" in front of the file name as shown in this example:

textureFile[0] = "/bowl.png";

In this example, the default wooden bowl texture will be used. Naturally, if someone changes that texture with a Recource Pack, your item will automatically be changed as well.

Packaging Textures in a .zip Files

When publishing a mod, you are able to package all of your files in a .zip file. All of your folders, and the mod.zip folder, should be in the root of your .zip file. The .zip file itself should itself should have the same name as your project.

The exception to these rules are the texture files. When reading a project from a .zip file, the textures will not be read from the /textures/ folder as they normally would. Instead, package them in a different folder with the following structure:

{projectName}.zip/mods/(mod name)/assets/(mod name)/textures/{folder}/{fileName}.png

"projectName" should be the same as the folder you've likely been using to construct your Custom Stuff project. Both the .zip file, and the sub-folder must be the exact same name in order for this to work. In the example above, "folder" is "/blocks/", "/items/", and so forth. The same sub-folders normally used in the /textures/ folder are used here as well.

You needn't include your normal /textures/ folder when distributing your project as a .zip since that would be needless padding from including all of your textures twice.

See Also

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.