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

In Custom Stuff 2, custom furnaces are a bit easier to make than in previous versions. You still need a custom furnace type block, a gui, and a container (now called a tile entity) to make a furnace work. Here is an example for setting up a furnace in CS2:

Furnace (CS2 0.10.0 and above)[]

config\CustomStuff\mods\yourMod\mod.js

2012-10-20 20.03
config.addBlockIdProperty("yourFurnaceID", 2102);
mod.addTileEntity("furnaceTile.js", "furnace");
mod.addGui("furnaceGUI.js", "furnace");
mod.addBlock("NF.js", "furnace");

config\CustomStuff\mods\yourMod\blocks\NF.js

id = config.getBlockId("yourFurnaceId");
name = "newFurnace";
material = "iron";
creativeTab = "decorations";

//inactive furnace
displayName[0] = "Your Furnace";
hardness[0] = 3.0;
drop[0] = 2102;
addToCreative[0] = true;
hasTileEntity[0] = true;
tileEntity[0] = "furnaceTile";
textureFileBack[0] = "yourFurnaceBack.png";
textureFileFront[0] = "yourFurnaceFront.png";
textureFileSides[0] = "yourFurnaceSides.png";
onActivated[0] = "player.openGui('furnaceGUI', position); result = true;";

//active furnace
light[1] = 10;
displayName[1] = "Your Furnace";
hardness[1] = 3.0;
drop[1] = 2102;
addToCreative[1] = true;
hasTileEntity[1] = true;
tileEntity[1] = "furnaceTile";
textureFileBack[1] = "yourFurnaceBack.png";
textureFileFront[1] = "yourFurnaceFront(on).png";
textureFileSides[1] = "yourFurnaceSides.png";
onActivated[1] = "player.openGui('furnaceGUI', position); result = true;";

config\CustomStuff\mods\yourMod\tileEntities\furnaceTile.js

2012-10-20 20.04
name = "furnaceTile";
ticksToSmelt = 200;

config\CustomStuff\mods\yourMod\guis\furnaceGUI.js

name = "furnaceGUI";
guiFile = "/gui/furnace.png";

The code until now only created a furnace with a different appearance. You can do so much more with it when you use your own RecipeLists.

First, you need to change the tileEntity to include usedRecipeLists and usedFuelLists with the list names you want to use.

config\CustomStuff\mods\yourMod\tileEntities\furnaceTile.js

name = "furnaceTile";
ticksToSmelt = 200;
usedRecipeLists = "EnhancerList";
usedFuelLists = "EnhancerList";

After that you just need some to add fuels and recipes for your machine.

config\CustomStuff\mods\yourMod\mod.js (to add:)

mod.addFuelFor("EnhancerList", "295:0", 50);
mod.addFuelFor("EnhancerList", "348:0", 1200);
mod.addAliasWithMetadata(2175, 0, "sicklysapling");
mod.addAliasWithMetadata(2175, 4, "robustsapling");
mod.addSmeltingRecipeFor("EnhancerList", "robustsapling", "sicklysapling");

This example uses seeds or glowstone dust to smelt a tree sapling from the Twilight Forest mod into a different sapling of the same mod.

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


CS1
Older Examples and Information for Custom Stuff 1.
NetherrackFurnace

A Furnace made from Netherrack just makes sense.

Custom Furnaces were introduced in Custom Stuff 2.3.0. While still not totally complete, they do function. Unfortunately, setting up a Custom Furnace is a multi-part process involving a block, a GUI, and a Container. All three of these items must be set up properly in order for your furnace to function properly.

In this example, we'll be setting up a netherrack furnace (shown at right). Each of the three main components will be shown, explained, and where needed broken down into sub-sections to make it easier to understand.


Furnace Block (CS1)[]

The furnace block can be made of any type of block, though people generally favor normal-type blocks as that's what's used in the vanilla game.

Block Basics[]

Here's the basic setup of the block.

name="Netherrack Furnace";
id=251;
texturefile="NetherSurvive.png";
textureindex=3;
textureindexnorth=2;
textureindexsouth=2;
textureindexeast=2;
textureindexwest=0;
hardness=2;
resistance=12;
material="rock";
stepsound="stone";
harvestlevel=0;
toolclass="pickaxe";
iddropped=251;
damagedropped=0;
movebypiston="false";
addtocreative="true";

There are a few things to note about this setup. First, the texture indexes are set up in a particular way to accommodate the 'shape' of the furnace. The 'textureindex' variable is the top and bottom of the furnace. The north, south, east, and west texture indexes are the sides and back, and 'textureindexwest' is the front (index 2 in this case). West has to be the front of the furnace (index 0 in this case) to make it match how a normal furnace shows up in the player's inventory, with the front facing to the left.

The 'movebypison' MUST be set to false for a furnace. If it is not, and a player moves it with a piston, the game will crash. For this reason, it is very important that this attribute be set correctly.



Preparing for the Container and GUI[]

The last two things that need to be taken care of are the container attribute, and the GUI function call. Add the following two lines to your .block file:

rightclicked="customstuff.openGui(origin, 'netherfurnace');";
container="NetherrackFurnace";

The top line will open the default furnace GUI when the block is right-clicked.

The second line lets the GUI know what container is going to be used for the furnace. A furnace MUST have a container set up for it to function, as explained in the next step.

Furnace Container[]

The furnace container is a pretty easy thing to set up in Custom Stuff 2.3.0 since it contains a maximum of four lines. This file has to be saved with the extension ".container" in the folder /.minecraft/config/customContainers/ in order for it to be found.

Here's our furnace container:

name="NetherrackFurnace";
type="furnace";
speed=200;
usedrecipes="vanilla";

The name must match the value of the 'container' attribute on our .block file exactly for it to work.

A speed of 200 is the default for a furnace. To make the furnace go faster, decrease this value. To make it slower, increase the value.

Finally, usedrecipes is set to "vanilla" in this example because I want it to be able to smelt everything that a normal furnace can. If you want to have smelting recipes exclusive to your custom furnace, you can change this value to anything you want. Just know that you'll also have to give your smelting recipes the same value. You can also have multiple values, separated with a comma.

Furnace GUI[]

For the most part, you'll want to use "defaultfurnace" as your GUI since it's the same furnace GUI used by the vanilla furnaces (for the most part). For information on creating your own furnace GUI, or altering the existing one, see GUI.

For this example, we're going to be changing things just a little bit to let players know that our furnace is different.

We're going to start by copying the defaultfurnace gui file in /.minecraft/config/customGuis/, and renaming the copy to netherfurnace.gui

Most of it we're going to leave the same because there's really no reason to change the layout much. What we are going to change are the following lines:

name = "netherfurnace";
id = 66;
stringtext1 = "Netherrack Furnace";
stringcolor1 = 0x660000;
stringcolor2 = 0x660000;

Remember that the above are the ones that are changed. The rest of the GUI file must still be in place.

The name of the furnace needs to be changed to match the name we called with the rightclicked trigger in the block example above.

Because this is now a different GUI, the id of the gui needs to be changed. Keep in mind that GUI IDs don't draw from the same pool as block and item IDs, so you can pick virtually any arbitrary (or symbolic) number and it'll work just fine.

The last three are purely aesthetic changes. The stringtext1 line changes the text at the top of the furnace GUI to "Netherrack Furnace" to provide a visual cue that this furnace is different from the normal one. The two 'stringcolor' attributes have been changed to give the text a reddish color, further cementing that this is a nether furnace in the player's mind.

Limitations[]

  • There is presently no good way to set the facing of a furnace block.
Advertisement