Tutorials Navigation

Tutorials :: New :: Popular :: Top Rated

Tutorials: 18,326 Categories: 12

Total Tutorial Views: 41,459,909

[ Minecraft ] How To Make Your Own Torch! [ Any I Think :D ]

Tutorial Name: [ Minecraft ] How To Make Your Own Torch! [ Any I Think :D ]  

Category: PC Tutorials

Submitted By: Console

Date Added:

Comments: 0

Views: 6,966

Related Forum: PC Building Forum

Share:

Hey Guys Again Well Here Is The Tutorial!




Making a new Torch:




In this tutorial i will explain you how to make a new torch. First of all make a new class called mod_Torch(could be whatever you want to call it but has to be with mod_ in the beginning). Inside mod_Torch you will see this:




package net.minecraft.src;

public class mod_Torch {

}





You will only see this if you use an editor like Eclipse.




Now type:

 extends BaseMod





after mod_Torch, it will look like this:





package net.minecraft.scr;

public class mod_Torch extends BaseMod

{

}





You declare your blocks and items inside public class mod_Torch extends BaseMod

Now add


    public mod_Torch()

    {

       

    }




inside




public class mod_Torch extends BaseMod

{

HERE

}

Inside public mod_Torch() you will declare the names and textures.




Your code will now look like this:





package net.minecraft.src;

public class mod_Torch extends BaseMod

{

    public mod_Torch()

    {

       

    }

   

}





Okay now you need to add:


    public String Version()

    {

        return "VERSION HERE!";

    }





This is where you add the version of your mod.

Now you have done the basic part of the mod. This will do nothing at the moment.




Now we will add the torch to the mod.




Ok add this:


public static final Block NewTorch = new BlockTorch(Block ID, 0).setHardness(0.0F).setLightValue(1.0F).setBlockName("The name of your torch here").disableNeighborNotifyOnMetadataChange();





Inside this:


package net.minecraft.src;

public class mod_Torch extends BaseMod

{

    [color="#0000FF"]Add it here![/color]

    public mod_Torch()

    {

       

    }




    public String Version()

    {

        return "1.0 for Minecraft Beta 1.7.3";

    }

   

}





Okay i will explain every part of this now:


public static final Block NewTorch = new BlockTorch(Block ID, 0).setHardness(0.0F).setLightValue(1.0F).setBlockName("The name of your torch here").disableNeighborNotifyOnMetadataChange();





public static final is just standart for the block, in a later tutorial you will see that there are more options but i/Mad will explain this later.




Block means it's a block and GlowTorch is just the name of the block. = is to declare that public static final Block NewTorch is equal to new BlockTorch(Block ID, 0) etc.




new BlockTorch means it's a new Block with the script of BlockTorch. You need to change Block ID in a number that is not used by another block, maximum is 255, check google for block id's. .setHardness(0.0F) means it's super easy to break, you can change 0.0 in an other number but because we make a torch i will leave this. .setLightValue(1.0F) is the amount of light it gives off, if i am right 1.0 is the max, if you set it higher mc will crash. The default light value of a torch is 0.9375F. Next the .setBlockName part, this is used to give your block a name, so between the " " you type it's name.




Okay now we will add the texture etc:




Your code atm:


package net.minecraft.src;

public class mod_Torch extends BaseMod

{

   
    //Declaring the blocks

    public static final Block NewTorch = new BlockTorch(1, 0).setHardness(0.0F).setLightValue(1.0F).setBlockName("New Torch").disableNeighborNotifyOnMetadataChange();






    public mod_Torch()

    {

       

    }






    public String Version()

    {

        return "1.0 for Minecraft Beta 1.7.3";

    }

   

}





Okay now we will add the textures etc with this:


                NewTorch.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/NewTorch.png");

        ModLoader.AddName(NewTorch, "New Torch");

        ModLoader.RegisterBlock(NewTorch);

        ModLoader.AddRecipe(new ItemStack(NewTorch, 1), new Object []

        {

            "S", "G", Character.valueOf('S'), Item.stick, Character.valueOf('G'), Item.lightStoneDust

        });





Okay i will explain more about them:


NewTorch.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/NewTorch.png");





means that the block NewTorch get the texture NewTorch.png and that the texture NewTorch.png is inside the folder textures.




Now AddName:


ModLoader.AddName(NewTorch, "New Torch");





This means that the block NewTorch gets the name New Torch ingame.




And now:

ModLoader.RegisterBlock(NewTorch);





This means that NewTorch get registered as a block ingame.




And now the last part of the code:





        ModLoader.AddRecipe(new ItemStack(NewTorch, 1), new Object []

        {

            "S", "G", Character.valueOf('S'), Item.stick, Character.valueOf('G'), Item.lightStoneDust

        });





Okay this means that a new recipe gets added. The NewTorch part can be changed to any item/blockname and the 1 stand for the amount of items/blocks you will get with this recipe. The recipe is a stick under glowstone dust, some names are different than ingame, see that S means Item.stick and that G means Item.lightStoneDust? If you change the item of S into like... cobblestone then you make it like this Character.valueOf('S'), Block.cobblestone.




Now you just need to make an sprite for the torch with 16x16 pixels, and make an folder to put it in. After you've done that place them into mcp/jars/bin/minecraft.jar. Run minecraft through Eclipse.




Thanks To - Madz
Hey Guys I Won't Be Posting Any Tutorials May 19 Cause Its My B-Day. So Well Their.

Ratings

Current rating: 5.30 by 10 users
Please take one second and rate this tutorial...

Not a Chance
1
2
3
4
5
6
7
8
9
10
Absolutely

Comments

"[ Minecraft ] How To Make Your Own Torch! [ Any I Think :D ]" :: Login/Create an Account :: 0 comments

If you would like to post a comment please signin to your account or register for an account.