Posted August 20, 201312 yr Forge 7.8.1.738, Minecraft 1.5.2 I'm trying to use Mod.name() to print the name of the mod in a debug message using System.out.println but I keep getting this error: Cannot make a static reference to the non-static method name() from the type Mod In the past you used to be able to reference modid, name and version from the Mod class. Several tutorials I've seen use this in registerIcons() to refer to the mod package. Is this no longer possible?
August 20, 201312 yr Author That message is pretty self explanatory. Basic java: You can't call a non-static method without an instance available. I understand the message, but how do you expose the Mod.name, Mod.modid and Mod.version information that gets set in the main class file? I would think that as soon as @PreInit is called an instance of the main class has been created. Obviously it's available somewhere because it gets listed in the "Mods" list in the Minecraft GUI.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.