Results 1 to 10 of 10
- 07-06-2012, 03:10 AM #1
Member
- Join Date
- Jul 2012
- Posts
- 5
- Rep Power
- 0
-
Re: Syntax error on token "}", super expected
That code doesn't make sense. What are you trying to do just past the red-lined closing brace in the parenthesis?
I'm talking about the line that begins (EntityFan.class,....
It just doesn't make sense.
- 07-06-2012, 03:21 AM #3
Member
- Join Date
- Jul 2012
- Posts
- 5
- Rep Power
- 0
Re: Syntax error on token "}", super expected
it was originally the same as the line above the closing brace with the map.put in front, but it gave me an error with that . I got rid of that and now it's fixed. The only error in the code that it is showing is the one that I mentioned above.
-
Re: Syntax error on token "}", super expected
- 07-06-2012, 03:55 AM #5
Member
- Join Date
- Jul 2012
- Posts
- 5
- Rep Power
- 0
Re: Syntax error on token "}", super expected
This is the relevant code for what I'm trying to do
The error said "Syntax error on token "}", super expected" on that one closing brace.Java Code:// Adoring Fan //register the entity ModLoader.registerEntityID(EntityFan.class, "Adoring Fan", ModLoader.getUniqueEntityId()); ModLoader.addSpawn("Adoring Fan", 100, 1, 50, EnumCreatureType.creature, new BiomeGenBase[] { BiomeGenBase.plains }); } public void generateSurface(World world, Random random, int chunkX, int chunkZ) { randomGenerator = random; for (int i = 0; i < 1; i++) { int randPosX = chunkX + randomGenerator.nextInt(16); int randPosY = random.nextInt(60); int randPosZ = chunkZ + randomGenerator.nextInt(16); (new WorldGenMinable(sapBlock.blockID, 50)).generate(world, random, randPosX, randPosY, randPosZ); } } public String getVersion() { return "Realms Mod Version 1.0"; } public void addRenderer(Map map) { map.put(EntityPenguin.class, new RenderPenguin(new ModelPenguin(), 0.5F)); } (EntityFan.class, new RenderFan(new ModelAdoringFan(), 0.5F)); }}Last edited by amentjacob1; 07-06-2012 at 03:57 AM.
-
Re: Syntax error on token "}", super expected
Again you have code that doesn't make sense, that isn't Java even:
The code that I've indicated above, the code below the comment makes no sense and isn't valid Java. There is no method call, no constructor call, but instead a naked parenthesis with some code in it. I can't make heads or tails of it. And it's not even being called in a method or constructor block.Java Code:public void addRenderer(Map map) { map.put(EntityPenguin.class, new RenderPenguin(new ModelPenguin(), 0.5F)); } // again, what the heck is the code below this comment supposed to be doing? (EntityFan.class, new RenderFan(new ModelAdoringFan(), 0.5F)); }}
Edit: The offending line appear similar to the line above it, as if you were trying to use it as a parenthesis of a map.put(...) method call, but forgot the map.put part, and forgot to call it inside of a method block, but instead have it hanging out naked in your class.
Again, what are you trying to do with that line? Also, what is the purpose of your project, and how well versed are you in Java programming?Last edited by Fubarable; 07-06-2012 at 04:04 AM.
- 07-06-2012, 04:04 AM #7
Member
- Join Date
- Jul 2012
- Posts
- 5
- Rep Power
- 0
Re: Syntax error on token "}", super expected
I am trying to make a mod for Minecraft, I know barely anything about Java, only watched a few tutorials on how to make this stuff which is the other code. What I am trying to do is make it so that that entity renders in the game. (or whatever that does...it wasn't explained very well)
-
Re: Syntax error on token "}", super expected
You're trying to do some fairly complex Java coding then without knowing basic Java syntax, and that won't work, since you can't just make up code and hope or pray that it will work. I strongly urge you to put aside your project for now go through some basic tutorials if you want to avoid a *lot* of frustration. This is a very good one here: The Java Tutorials: The Really Big Index
- 07-06-2012, 04:14 AM #9
Member
- Join Date
- Jul 2012
- Posts
- 5
- Rep Power
- 0
Re: Syntax error on token "}", super expected
Thanx, I'll get to that tomorrow i think
-
Re: Syntax error on token "}", super expected
Put another way:
the code above is valid Java. You have created a method, addRenderer, and inside of the method, you are calling a method of the map object. Note that this method call is made *inside* of the addRenderer method, a key point.Java Code:public void addRenderer(Map map) { map.put(EntityPenguin.class, new RenderPenguin(new ModelPenguin(), 0.5F)); }
This code below however:
is not inside of any method, so it is invalid due to its location. But not only that it looks as if it were beheaded. You have the method parameter but no object (such as map in the valid code above), and no method name (such as put in the method above). So it is senseless.Java Code:(EntityFan.class, new RenderFan(new ModelAdoringFan(), 0.5F)); }}
Similar Threads
-
Java "Identifier Expected" Error
By Misho554 in forum New To JavaReplies: 3Last Post: 03-15-2012, 05:09 PM -
Syntax error in eclipse for "enum" defination.
By gunwantw in forum EclipseReplies: 1Last Post: 07-08-2010, 09:21 AM -
Syntax error on token "(", ; expected
By baltimore in forum AWT / SwingReplies: 3Last Post: 10-28-2009, 12:19 AM -
Syntax error on token "(", ; expected
By romilc in forum New To JavaReplies: 7Last Post: 10-24-2009, 01:23 AM -
error"<identifier> expected" trough the use of interface
By parme in forum New To JavaReplies: 3Last Post: 12-05-2008, 08:34 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks