Reputation: 137
As a CS Student, I was trying to do something with Java so I decided to make a Minecraft mod, following this https://www.youtube.com/watch?v=2_qM-Z0IQ4k tutorial. At around 13:10 he opens Minecraft from eclipse, but whenever I try to do it, it gives me a few errors.
The first one that I've "fixed" was that the java.library.path did not contain lwjgl64. I fixed it by downloading lwjgl from https://www.lwjgl.org/download and following these instructions. http://wiki.lwjgl.org/wiki/Downloading_and_Setting_Up_LWJGL For the native library location I pointed it towards the folder with the extracted lwjgl.zip in it. (I am including this part because I may have done something wrong at this stage but am unsure of it.)
Now that that problem was fixed, the problem arose that I could not launch as there we no recent launches so I found THIS https://www.youtube.com/watch?v=kGGV6G3pPB4 video which showed how to get eclipse to do that, and it worked!... except that my class doesn't have a main method in it.
Sorry if my wording/explanation is jumbled - basically, how do I get eclipse to launch Minecraft with the mod loaded? I have installed all prerequisites.
Here is my "main class" below.
package com.gmail.nameredacted.magicmirror;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import com.gmail.nameredacted.magicmirror.init.MagicMirrorItems;
import com.gmail.nameredacted.magicmirror.proxy.CommonProxy;
@Mod(modid = Reference.MOD_ID, name = Reference.NAME, version = Reference.VERSION)
public class MagicMirror
{
@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
public static CommonProxy proxy;
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
MagicMirrorItems.init();
MagicMirrorItems.register();
}
@EventHandler
public void init(FMLInitializationEvent event)
{
proxy.registerRenders();
}
@EventHandler
public void postInit(FMLPostInitializationEvent event)
{
}
}
Upvotes: 0
Views: 4960
Reputation: 137
I found the solution. It seems that someone else had the same issue as me, http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/2574505-cant-run-minecraft-from-eclipse, and what I did was that I went to Run -> Run Configurations and clicked on Java Applications. For the Project I chose my current project file, and for the Main Class I typed in "GradleStart" and it worked.
Upvotes: 3