public course mod_MyMod extend BaseModpublic wire Version() return "1.2_02";public void AddRecipes(CraftingManager recipes) recipes.addRecipe(new ItemStack(Item.diamond), brand-new Object<> "#", Character.valueOf("#"), Block.dirt );When I shot to compile the I gain the following error:

java:11: reached end of record while parsing }What am ns doing wrong? Any assist appreciated.

You are watching: Reach end of file while parsing java


*

You need to open and close your class with ... like:

public course mod_MyMod extend BaseMod windy String Version() return "1.2_02"; publicly void AddRecipes(CraftingManager recipes) recipes.addRecipe(new ItemStack(Item.diamond), brand-new Object<> "#", Character.valueOf("#"), Block.dirt );

*

*

You must enclose your course in and also . A couple of extra pointers: follow to the Java coding conventions, girlfriend should

Put her { top top the very same line as the method declaration:Name her classes utilizing CamelCase (with initial funding letter)Name your methods using camelCase (with tiny initial letter)

Here"s just how I would certainly write it:

public class ModMyMod extends BaseMod public String version() return "1.2_02"; public void addRecipes(CraftingManager recipes) recipes.addRecipe(new ItemStack(Item.diamond), new Object<> "#", Character.valueOf("#"), Block.dirt );

*

It happens once you don"t effectively close the code block:

if (condition){ // your password goes here* { // This doesn"t nearby the password blockCorrect way:

if (condition) // your password goes here // close the password block

*

Yes. You were absent a "{" under the public class line. And then one in ~ the finish of your code to near it.


Thanks for contributing response to stack Overflow!

Please be sure to answer the question. Carry out details and share her research!

But avoid

Asking for help, clarification, or responding to other answers.Making statements based on opinion; back them increase with referrals or personal experience.

See more: Which Dog Breed With Best Sense Of Smell, The 10 Dog Breeds With The Best Sense Of Smell

To learn more, view our tips on writing good answers.


write-up Your price Discard

By click “Post your Answer”, girlfriend agree to our terms of service, privacy policy and also cookie policy


Not the answer you're feather for? Browse other questions tagged java compiler-errors or questioning your own question.


What is the "reached end of paper while parsing" error, and also how can I protect against this error in the future?
site design / logo design © 2021 stack Exchange Inc; user contributions licensed under cc by-sa. Rev2021.11.4.40656


your privacy

By clicking “Accept every cookies”, friend agree ridge Exchange deserve to store cookie on your maker and disclose information in accordance v our Cookie Policy.