Jump to content

Recommended Posts

Posted

Uhm when i did basic stuff with modloader i had a working tool set, but now i cant seem to figure out how to get it right. My tools are different but they dont brake. So i just want to ask for a simple answer on this question: "how to add a tool with minecraft forge?"

 

This is what i have now:

 

This is the file for my Pickaxe

 

 

package net.minecraft.src;

 

import net.minecraftforge.client.*;

 

public class ItemCopperPickaxe extends ItemPickaxe

{

protected ItemCopperPickaxe(int i, EnumToolMaterial copper)

{

super(i, copper);

}

    public String getTextureFile()

    {

        return "/mod_Ores/gui/ItemsMe.png";

    }

}

 

 

Then i have this in my mod_**file

 

 

public static final Item CopperPickaxe = (new ItemCopperPickaxe(1063,EnumToolMaterial.COPPER).setIconIndex(90).setItemName("CopperPickaxe"));

 

public void load()

{

MinecraftForgeClient.preloadTexture("/mod_Ores/Blocks.png");

        MinecraftForgeClient.preloadTexture("/mod_Ores/gui/ItemsMe.png");

        MinecraftForge.setToolClass(CopperAxe, "axe", 1);

 

ModLoader.addName(CopperPickaxe,"Copper Pickaxe");

 

 

ModLoader.addRecipe(new ItemStack(mod_Ores.CopperPickaxe, 1), new Object[]

{

"XXX"," Y " ," Y " ,  'Y', Item.stick, 'X', mod_Ores.CopperIngot

});

 

 

 

 

This is what i have in the EnumToolMaterial

 

 

public enum EnumToolMaterial

{

    WOOD(0, 59, 2.0F, 0, 15),

    STONE(1, 131, 4.0F, 1, 5),

    IRON(2, 250, 6.0F, 2, 14),

    EMERALD(3, 1561, 8.0F, 3, 10),

    GOLD(0, 32, 12.0F, 0, 22),

BRONZE(2, 180, 5.8F, 2, 12),

CHROMITE(1, 95, 4.5F, 1, 16),

COBALT(2, 230, 6.5F, 1, 14),

COPPER(1, 128, 5.3F, 1, 9),

MITHRIL(5, 1242, 10.0F, 4, 15),

SILVER(3, 307, 9.0F, 3, 20),

STEEL(4, 698, 7.0F, 3, 18),

TANZANITE(1, 125, 5.0F, 1, 11),

TIN(1, 128, 5.3F, 1, 9),

EMMI(2, 260, 7.6F, 2, 14),

SAPPHIRE(2, 220, 7.2F, 2, 13),

RUBY(2 ,240, 7.4F, 2, 14);

 

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.