MC Modding
Please register and join the community!


Join the forum, it's quick and easy

MC Modding
Please register and join the community!
MC Modding
Would you like to react to this message? Create an account in a few clicks or log in to continue.

[UnAnswered]Tool Error.

3 posters

MC Modding :: Help :: Help

Go down

[UnAnswered]Tool Error. Empty [UnAnswered]Tool Error.

Post by breakyorself Mon Oct 24, 2011 4:41 am

I tried making tools:
Code:
package net.minecraft.src;
import java.util.Random;

public class mod_Obsidian extends BaseMod
{

public static final Item Pick = new ItemPickaxe(2001, EnumToolMaterial.EMERALD).setItemName("Obsidian Pickaxe");
public static final Item Spade = new ItemSpade(2002, EnumToolMaterial.EMERALD).setItemName("Obsidian Spade");
public static final Item Axe = new ItemAxe(2003, EnumToolMaterial.EMERALD).setItemName("Obsidian Axe");
public static final Item Hoe = new ItemHoe(2004, EnumToolMaterial.EMERALD).setItemName("Obsidian Hoe");
public static final Item Sword = new ItemSword(2005, EnumToolMaterial.EMERALD).setItemName("Obsidian Hoe");

public mod_Obsidian()
{

Pick.iconIndex = ModLoader.addOverride("/gui/items.png", "/obsidian/Pick.png");
Spade.iconIndex = ModLoader.addOverride("/gui/items.png", "/obsidian/Spade.png");
Axe.iconIndex = ModLoader.addOverride("/gui/items.png", "/obsidian/Axe.png");
Hoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/obsidian/Hoe.png");
Sword.iconIndex = ModLoader.addOverride("/gui/items.png", "/obsidian/Sword.png");


ModLoader.AddName(Pick, "Pickaxe");
ModLoader.AddName(Spade, "Shovel");
ModLoader.AddName(Axe, "Axe");
ModLoader.AddName(Hoe, "Hoe");
ModLoader.AddName(Sword, "Sword");


ModLoader.AddRecipe(new ItemStack(Pick, 1), new Object[] {
"$$$", " * ", " * ", Character.valueOf('*'), Item.stick, Character.valueOf('$'), Block.obsidian
});
ModLoader.AddRecipe(new ItemStack(Axe, 1), new Object[] {
"** ", "*# ", " # ", Character.valueOf('*'), Block.obsidian, Character.valueOf('#'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(Spade, 1), new Object[] {
"#", " * ", " * ", Character.valueOf('*'), Item.stick, Character.valueOf('#'), Block.obsidian
});
ModLoader.AddRecipe(new ItemStack(Hoe, 1), new Object[] {
"$$", " * ", " * ", Character.valueOf('*'), Item.stick, Character.valueOf('$'), Block.obsidian
});
ModLoader.AddRecipe(new ItemStack(Sword, 1), new Object[] {
" $ ", " $ ", " * ", Character.valueOf('*'), Item.stick, Character.valueOf('$'), Block.obsidian
});
}

public String Version()
{
return "3.14159265";
}
}


Error report:
Spoiler:
breakyorself
breakyorself
Member

Posts : 60
Join date : 2011-10-19

Back to top Go down

[UnAnswered]Tool Error. Empty Re: [UnAnswered]Tool Error.

Post by filip151 Tue Oct 25, 2011 5:21 pm

hmm, maybe I can help you use my code
Code:
package net.minecraft.src;

import java.util.Random;

public class mod_Bronzetools extends BaseMod
{
  public static final Item Bronzepick = new ItemPickaxe(1000, EnumToolMaterial.BRONZE).setItemName("Bronzepick");
  public static final Item Bronzeshovel = new ItemSpade(1001, EnumToolMaterial.BRONZE).setItemName("Bronzeshovel");
  public static final Item Bronzeaxe = new ItemAxe(1002, EnumToolMaterial.BRONZE).setItemName("Bronzeaxe");
  public static final Item Bronzehoe = new ItemHoe(1003, EnumToolMaterial.BRONZE).setItemName("Bronzehoe");
  public static final Item Bronzesword = new ItemSword(1004, EnumToolMaterial.BRONZE).setItemName("Bronzesword");
     
public mod_Bronzetools()
{

               
        //Textures
       Bronzepick.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textur/pick1.png");
       Bronzeshovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textur/spade1.png");
       Bronzeaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textur/axe1.png");
       Bronzehoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textur/hoe1.png");
       Bronzesword.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textur/sword1.png");
 
        //In Game Names
  ModLoader.AddName(Bronzepick, "Bronze Pickaxe");
  ModLoader.AddName(Bronzeshovel, "Bronze Shovel");
  ModLoader.AddName(Bronzeaxe, "Bronze Axe");
  ModLoader.AddName(Bronzehoe, "Bronze Hoe");
  ModLoader.AddName(Bronzesword, "Bronze Sword");
 
        //Recipes
  ModLoader.AddRecipe(new ItemStack(Bronzepick, 1), new Object[] {
            "XXX", " | ", " | ", Character.valueOf('X'), mod_Bronzeingot.Bronzeingot, Character.valueOf('|'), Item.stick
        });
  ModLoader.AddRecipe(new ItemStack(Bronzeshovel, 1), new Object[] {
            " X ", " | ", " | ", Character.valueOf('X'), mod_Bronzeingot.Bronzeingot, Character.valueOf('|'), Item.stick
        });
  ModLoader.AddRecipe(new ItemStack(Bronzeaxe, 1), new Object[] {
            "XX ", "X| ", " | ", Character.valueOf('X'), mod_Bronzeingot.Bronzeingot, Character.valueOf('|'), Item.stick
        });
  ModLoader.AddRecipe(new ItemStack(Bronzehoe, 1), new Object[] {
            "XX ", " | ", " | ", Character.valueOf('X'), mod_Bronzeingot.Bronzeingot, Character.valueOf('|'), Item.stick
        });
  ModLoader.AddRecipe(new ItemStack(Bronzesword, 1), new Object[] {
            " X ", " X ", " | ", Character.valueOf('X'), mod_Bronzeingot.Bronzeingot, Character.valueOf('|'), Item.stick
        });
  }
     


 public String Version()
  {
  return "1.8.1";
  }

}
then just change the EnumToolMatereial.BRONZE to EnumToolMatereial.EMERALD and all the names to yours, then it should work! If you still get the error, then I don't know.

filip151
Member

Posts : 11
Join date : 2011-10-21
Age : 26
Location : Norway, Oslo Poland, Swiecie

Back to top Go down

[UnAnswered]Tool Error. Empty Re: [UnAnswered]Tool Error.

Post by breakyorself Wed Oct 26, 2011 1:39 am

I know the enumtoolmaterial and i created my own material.
breakyorself
breakyorself
Member

Posts : 60
Join date : 2011-10-19

Back to top Go down

[UnAnswered]Tool Error. Empty Re: [UnAnswered]Tool Error.

Post by lildudemike Mon Dec 05, 2011 4:38 am

You need to personalize it more with more files. Instead of
public static final Item Pick = new ItemPickaxe
it should be
public static final emeraldPickaxe = new ItemPickaxeEmerald

Then you will need to create a file called ItemPickaxeEmerald and copy the code from ItemPickaxe into it, replace ItemPickaxe with ItemPickaxeEmerald and enjoy. Smile

or if you don't need it to be so personalized you could just do

public static final Item emeraldPickaxe = new ItemPickaxe


Last edited by lildudemike on Mon Dec 05, 2011 4:40 am; edited 1 time in total (Reason for editing : didn't realize that it didn't have to be that personalized)

lildudemike
Member

Posts : 2
Join date : 2011-12-04

Back to top Go down

[UnAnswered]Tool Error. Empty Re: [UnAnswered]Tool Error.

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

MC Modding :: Help :: Help

 
Permissions in this forum:
You cannot reply to topics in this forum