Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

Using the eclipse debugger

IMarvinTPA edited this page Oct 29, 2016 · 7 revisions

Using the Eclipse debugger

Note: This works not only for InvTweaks, but also for any modding project that isn't developed with the Minecraft Coder Pack.

Step 1: Launching Minecraft in debug mode

The easy way

(Help: Which folder do you run this command in? I get errors in the root that git clone created.)

If you can build InvTweaks with mvn clean install, do it once, then run Minecraft using the launcher/run.bat or launcher/run.sh script. You can launch the script from Eclipse using "Run > External Tools > External Tools Configuration... > Program".

Manually

  • Get the .jar launcher from minecraft.net
  • In the same directory as your launcher, create a file (as run.bator run.sh according to your OS) and set its contents to:
javaw -Xmx1024m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 -Dsun.java2d.noddraw=true -Dsun.java2d.d3d=false -Dsun.java2d.opengl=false -Dsun.java2d.pmoffscreen=false -classpath minecraft.jar net.minecraft.LauncherFrame
  • Launch the script

Step 2: Configuring Eclipse

  • Run > Debug configurations...
  • Double-click on "Remote Java application" to create a new config
  • Make sure your mod project is selected, the other options should be fine by default (Connection type: "Socket attach", Host: "localhost", Port: "8000")
  • When Minecraft is launched (with the custom script) run the Debug configuration. You can now use breakpoints to pause the code, view the variables etc.