Results 1 to 8 of 8
  1. #1
    CrazyTofu999 is offline Member
    Join Date
    Jan 2013
    Posts
    5
    Rep Power
    0

    Angry Random Error Message ')' expected

    In my code I keep getting just a single error message:

    src/minecraft/net/minecraft/src/mod_Mob.java:23: ')' expected
    map.put(EntityIndiana.class, new RenderIndiana(new ModelIndiana(), 0.5F);


    I guess It's right in the sense that I need two parentheses after the 0.5F at line 23 but If I try that it explodes in errors

    Here's my code:

    Java Code:
    package net.minecraft.src;
    import java.util.Random;
    import java.util.Map;
    
    public class mod_Mod extends BaseMod 
    {
    
    	
    	public mod_Mod()
    	{
    		AddMobs();
    	}
    	
    	public void AddMobs()
    	{
    		ModLoader.RegisterEntityID(EntityIndiana.class, "Indiana Jones", ModLoader.getUniqueEntityId());
    		
    		ModLoader.AddSpawn(EntityIndiana.class, 500, EnumCreatureType.creature);
    	}
    	
    	public void AddRenderer(Map map)
    	{
    		map.put(EntityIndiana.class, new RenderIndiana(new ModelIndiana(), 0.5F);
    	}
    	
    
    	
    	public String getVersion()
    	{
    		return "3.14159265";	
    	}
    	public void load()
    	{	
    	}
    }
    I think It's a simple fix but I just can't nab it.

    Thanks :)

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default Re: Random Error Message ')' expected

    ')' expected
    Check that all the (s on the line with the error have a matching ).
    The compiler thinks there is a missing );

    If you can't see, print the line and use a pencil to circle the leftmost ( and draw a line to the rightmost ).
    Then go to the next ( and find its pairing ).

    Or add a comment line beneath the line with the error and put a 1 under the left most ( and the rightmost ).
    Move to the next ( and put a 2 under it and go to the right most ) without a number and put a 2 under it.
    Continue until you find the unpaired ()s

    it explodes in errors
    The one simple error is hiding the other errors. After fixing the ()s, copy and paste here the full text of the error messages.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    CrazyTofu999 is offline Member
    Join Date
    Jan 2013
    Posts
    5
    Rep Power
    0

    Default Re: Random Error Message ')' expected

    So If I add a ) before the semicolon at the end of line 23 I get these errors:

    == ERRORS FOUND ==

    src/minecraft/net/minecraft/src/mod_Mob.java:5: class mod_Mod is public, should be declared in a file named mod_Mod.java
    public class mod_Mod extends BaseMod
    ^

    src/minecraft/net/minecraft/src/EntityIndiana.java:3: net.minecraft.src.EntityIndiana is not abstract and does not override abstract method getMaxHealth() in net.minecraft.src.EntityLiving
    public class EntityIndiana extends EntityLiving
    ^

    src/minecraft/net/minecraft/src/EntityIndiana.java:65: cannot find symbol
    symbol : variable shiftedIndex
    location: class net.minecraft.src.Item
    dropItem(Item.bowlSoup.shiftedIndex, 1);
    ^

    src/minecraft/net/minecraft/src/EntityIndiana.java:66: cannot find symbol
    symbol : variable shiftedIndex
    location: class net.minecraft.src.Item
    dropItem(Item.brick.shiftedIndex, 5);
    ^

    src/minecraft/net/minecraft/src/mod_Mob.java:16: cannot find symbol
    symbol : method RegisterEntityID(java.lang.Class<net.minecraft.src .EntityIndiana>,java.lang.String,int)
    location: class net.minecraft.src.ModLoader
    ModLoader.RegisterEntityID(EntityIndiana.class, "Indiana Jones", ModLoader.getUniqueEntityId());
    ^

    src/minecraft/net/minecraft/src/mod_Mob.java:18: cannot find symbol
    symbol : method AddSpawn(java.lang.Class<net.minecraft.src.EntityI ndiana>,int,net.minecraft.src.EnumCreatureType)
    location: class net.minecraft.src.ModLoader
    ModLoader.AddSpawn(EntityIndiana.class, 500, EnumCreatureType.creature);
    ^

    src/minecraft/net/minecraft/src/ModelIndiana.java:7: cannot find symbol
    symbol : constructor ModelBiped(int,float)
    location: class net.minecraft.src.ModelBiped
    super(1, 0.0F);
    ^

    src/minecraft/net/minecraft/src/ModelIndiana.java:12: cannot find symbol
    symbol : method render(float,float,float,float,float,float)
    location: class net.minecraft.src.ModelBiped
    super.render(f, f1, f2, f3, f4, f5);
    ^

    src/minecraft/net/minecraft/src/ModelIndiana.java:18: cannot find symbol
    symbol : method setRotationAngles(float,float,float,float,float,fl oat)
    location: class net.minecraft.src.ModelBiped
    super.setRotationAngles(f, f1, f2, f3, f4, f5);
    ^

    src/minecraft/net/minecraft/src/ModelMob.java:7: cannot find symbol
    symbol : constructor ModelBiped(int,float)
    location: class net.minecraft.src.ModelBiped
    super(1, 0.0F);
    ^

    src/minecraft/net/minecraft/src/ModelMob.java:12: cannot find symbol
    symbol : method render(float,float,float,float,float,float)
    location: class net.minecraft.src.ModelBiped
    super.render(f, f1, f2, f3, f4, f5);
    ^

    src/minecraft/net/minecraft/src/ModelMob.java:18: cannot find symbol
    symbol : method setRotationAngles(float,float,float,float,float,fl oat)
    location: class net.minecraft.src.ModelBiped
    super.setRotationAngles(f, f1, f2, f3, f4, f5);
    ^

    src/minecraft/net/minecraft/src/RenderIndiana.java:41: preRenderScale(net.minecraft.src.EntityMob,float) in net.minecraft.src.RenderIndiana cannot be applied to (net.minecraft.src.EntityIndiana,float)
    preRenderScale((EntityIndiana)entityliving, f);
    ^

    13 errors
    ==================

    Any advice?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default Re: Random Error Message ')' expected

    mod_Mob.java:5: class mod_Mod
    The compiler is very fussy about spelling.

    The other errors are in other source files. See the text of the error messages. For example:
    c/minecraft/net/minecraft/src/EntityIndiana.java:3

    How many classes are you working on?
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    CrazyTofu999 is offline Member
    Join Date
    Jan 2013
    Posts
    5
    Rep Power
    0

    Default Re: Random Error Message ')' expected

    Im working on four classes: a general mod, an entity, model and a rendering class

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Random Error Message ')' expected

    Time to start fixing the errors one at a time. What have you tried and where are you stuck?

    But to correct your post's heading: there's nothing "random" about your error messages. You've got bugs in your code and need to fix them. With so many compilation errors, I suggest that you go about your coding process differently. You should either use an IDE which flags compilation errors immediately or compile often and fix all errors before trying to add new code. Else you'll end up with a rat's nest of errors.

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default Re: Random Error Message ')' expected

    Try compiling the source files mentioned in the list of error messages one at a time. Work on fixing the errors in each of them.
    If you don't understand my response, don't ignore it, ask a question.

  8. #8
    Join Date
    Jan 2013
    Posts
    24
    Rep Power
    0

    Default Re: Random Error Message ')' expected

    map.put(EntityIndiana.class, new RenderIndiana(new ModelIndiana(), 0.5F);
    Three left side parentheses, two right side?
    map.put(EntityIndiana.class, new RenderIndiana(new ModelIndiana()), 0.5F);
    //-^

Similar Threads

  1. ';' expected error
    By name in forum New To Java
    Replies: 19
    Last Post: 12-23-2011, 08:09 AM
  2. Replies: 2
    Last Post: 10-02-2010, 02:13 AM
  3. Error: ')' expected
    By baltimore in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:32 AM
  4. My error is: ')' expected
    By silvia in forum New To Java
    Replies: 1
    Last Post: 07-18-2007, 04:49 PM
  5. MSG ERROR: : expected
    By Marty in forum New To Java
    Replies: 1
    Last Post: 05-31-2007, 02:21 AM

Posting Permissions

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