Results 1 to 8 of 8
- 01-15-2013, 09:45 PM #1
Member
- Join Date
- Jan 2013
- Posts
- 5
- Rep Power
- 0
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:
I think It's a simple fix but I just can't nab it.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() { } }
Thanks :)
- 01-15-2013, 09:57 PM #2
Re: Random Error Message ')' expected
Check that all the (s on the line with the error have a matching ).')' expected
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
The one simple error is hiding the other errors. After fixing the ()s, copy and paste here the full text of the error messages.it explodes in errorsIf you don't understand my response, don't ignore it, ask a question.
- 01-15-2013, 10:46 PM #3
Member
- Join Date
- Jan 2013
- Posts
- 5
- Rep Power
- 0
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?
- 01-15-2013, 11:33 PM #4
Re: Random Error Message ')' expected
The compiler is very fussy about spelling.mod_Mob.java:5: class mod_Mod
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.
- 01-16-2013, 12:32 AM #5
Member
- Join Date
- Jan 2013
- Posts
- 5
- Rep Power
- 0
Re: Random Error Message ')' expected
Im working on four classes: a general mod, an entity, model and a rendering class
-
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.
- 01-16-2013, 12:48 AM #7
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.
- 01-16-2013, 07:08 PM #8
Member
- Join Date
- Jan 2013
- Posts
- 24
- Rep Power
- 0
Similar Threads
-
';' expected error
By name in forum New To JavaReplies: 19Last Post: 12-23-2011, 08:09 AM -
keep getting error message class, interface, or enum expected
By darr in forum New To JavaReplies: 2Last Post: 10-02-2010, 02:13 AM -
Error: ')' expected
By baltimore in forum New To JavaReplies: 1Last Post: 08-07-2007, 06:32 AM -
My error is: ')' expected
By silvia in forum New To JavaReplies: 1Last Post: 07-18-2007, 04:49 PM -
MSG ERROR: : expected
By Marty in forum New To JavaReplies: 1Last Post: 05-31-2007, 02:21 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks