Results 1 to 4 of 4
  1. #1
    Misho554 is offline Member
    Join Date
    Mar 2012
    Posts
    2
    Rep Power
    0

    Default Java "Identifier Expected" Error

    I have been trying to recompile this but I keep getting an <Identifier> Expected error on line 11.

    Java Code:
    package net.minecraft.src;
    import java.util.Random;
    
    public static final class mod_CookieArmor extends BaseMod
    {
    	public static final Item body = new ItemArmor(3000, EnumArmorMaterial.COOKIE, ModLoader.AddArmor("body"), 1).setItemName("Cookie Chestplate");
    	public static final Item legs = new ItemArmor(3001, EnumArmorMaterial.COOKIE, ModLoader.AddArmor("legs"), 2).setItemName("Cookie Leggings");
    	public static final Item helmet = new ItemArmor(3002, EnumArmorMaterial.COOKIE, ModLoader.AddArmor("helmet"), 3).setItemName("Cookie Helmet");
    	public static final Item boots = new ItemArmor(3003, EnumArmorMaterial.COOKIE, ModLoader.AddArmor("boots"), 0).setItemName("Cookie Boots");
    
    	public static final void(); mod_CookieArmor()
    	{
    		ModLoader.AddName(body, "Cookie Chestplate");
    		body.iconIndex = ModLoader.addOverride("/gui/items.png", "/Body.png");
    		ModLoader.AddRecipe(new ItemStack(body, 1), new Object[]{
    			"* *", "***", "***", Character.valueOf('*'), Item.cookie
    This is not the whole code. Any help would be greatly appreciated!

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,691
    Rep Power
    8

    Default Re: Java "Identifier Expected" Error

    What is this supposed to do:

    Java Code:
    public static final void(); mod_CookieArmor()
        {
    That is not proper syntax for declaring a method.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Misho554 is offline Member
    Join Date
    Mar 2012
    Posts
    2
    Rep Power
    0

    Default Re: Java "Identifier Expected" Error

    So how could I fix it? Sorry I'm very new to java.

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,691
    Rep Power
    8

    Default Re: Java "Identifier Expected" Error

    This is the first result of googling "java method declaration": Defining Methods (The Java™ Tutorials > Learning the Java Language > Classes and Objects)
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. "Identifier expected" problem
    By turtlish in forum New To Java
    Replies: 4
    Last Post: 12-09-2011, 07:30 PM
  2. Replies: 4
    Last Post: 10-20-2011, 05:10 AM
  3. Replies: 3
    Last Post: 01-31-2011, 09:46 AM
  4. Syntax error on token "(", ; expected
    By romilc in forum New To Java
    Replies: 7
    Last Post: 10-24-2009, 01:23 AM
  5. Replies: 3
    Last Post: 12-05-2008, 08:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •