Jump to content

Undefined Errors


Recommended Posts

The errors are the bolded text:

The error is: The constructor ToolAmethystSword(int, EnumToolMaterial) is undefined, ToolAmethystPickaxe cannot be resolved to a type, and The method setUnlocalizedName(String) in the type Item is not applicable for the arguments (Item).



package AmethystTools;


import net.minecraft.item.EnumToolMaterial;

import net.minecraft.item.Item;

import net.minecraft.item.ItemStack;

import net.minecraftforge.common.EnumHelper;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.EventHandler;

import cpw.mods.fml.common.event.FMLPreInitializationEvent;

import cpw.mods.fml.common.network.NetworkMod;

import cpw.mods.fml.common.registry.GameRegistry;

import cpw.mods.fml.common.registry.LanguageRegistry;


//Basic Mod Information

@Mod(modid = "Amethyst", name = "Amethyst", version = "0.0.1")


//Client & Server Side Requirements

@NetworkMod(clientSideRequired = true, serverSideRequired = false)


public class AmethystToolsMain {


//Define Tools

public static Item amethystSword;

public static Item amethystPickaxe;

public static Item amethystAxe;

public static Item amethystShovel;

public static Item amethystHoe;


//Define Material

public static EnumToolMaterial Amethyst = EnumHelper.addToolMaterial("Amethyst", 3, 1200, 7.0F, 2.5F, 10);


@EventHandler <---This was imported already.

public void load(FMLPreInitializationEvent Event) {


//Tool Settings

amethystSword = new ToolAmethystSword(1000, Amethyst);

amethystPickaxe = new ToolAmethystPickaxe(1001, Amethyst);

amethystAxe = new ToolAmethystAxe(1002, Amethyst);

amethystShovel = new ToolAmethystSword(1003, Amethyst);

amethystHoe = new ToolAmethystSword(1004, Amethyst);


//Register Tools

GameRegistry.registerItem(amethystSword, "amethystSword");

LanguageRegistry.addName(amethystSword, "Amethyst Sword");


GameRegistry.registerItem(amethystPickaxe, "amethystPickaxe");

LanguageRegistry.addName(amethystPickaxe, "Amethyst Pickaxe");


GameRegistry.registerItem(amethystAxe, "amethystAxe");

LanguageRegistry.addName(amethystAxe, "Amethyst Axe");


GameRegistry.registerItem(amethystShovel, "amethystShovel");

LanguageRegistry.addName(amethystShovel, "Amethyst Shovel");


GameRegistry.registerItem(amethystHoe, "amethystHoe");

LanguageRegistry.addName(amethystHoe, "Amethyst Hoe");


//Define Recipes for Tools

GameRegistry.addRecipe(new ItemStack(amethystSword), new Object[] {" A ", " A ", " S ", 'A', Item.amethystGem, 'S', Item.stick});

GameRegistry.addRecipe(new ItemStack(amethystPickaxe), new Object[] {"AAA", " S ", " S ", 'A', Item.amethystGem, 'S', Item.stick});

GameRegistry.addRecipe(new ItemStack(amethystAxe), new Object[] {"AA ", "AS ", " S ", 'A', Item.amethystGem, 'S', Item.stick});

GameRegistry.addRecipe(new ItemStack(amethystShovel), new Object[] {" A ", " S ", " S ", 'A', Item.amethystGem, 'S', Item.stick});

GameRegistry.addRecipe(new ItemStack(amethystHoe), new Object[] {"AA ", " S ", " S ", 'A', Item.amethystGem, 'S', Item.stick});









Link to comment
Share on other sites

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.

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.