Skip to content

Launching The Game

Fabric Loom provides a variety of launch profiles to help you start and debug your mods in a live game environment. This guide will cover the various launch profiles and how to use them to debug and playtest your mods.

Launch Profiles

If you're using IntelliJ IDEA, you can find the launch profiles in the top-right corner of the window. Click the dropdown menu to see the available launch profiles.

There should be a client and server profile, with the option to either run it normally or in debug mode:

Launch Profiles

Gradle Tasks

If you're using the command line, you can use the following Gradle commands to start the game:

  • ./gradlew runClient - Start the game in client mode.
  • ./gradlew runServer - Start the game in server mode.

The only problem with this approach is that you can't easily debug your code. If you want to debug your code, you'll need to use the launch profiles in IntelliJ IDEA or via your IDE's Gradle integration.

Hotswapping Classes

When you run the game in debug mode, you can hotswap your classes without restarting the game. This is useful for quickly testing changes to your code.

You're still quite limited though:

  • You can't add or remove methods
  • You can't change method parameters
  • You can't add or remove fields

Hotswapping Mixins

If you're using Mixins, you can hotswap your Mixin classes without restarting the game. This is useful for quickly testing changes to your Mixins.

You will need to install the Mixin java agent for this to work though.

1. Locate the Mixin Library Jar

In IntelliJ IDEA, you can find the mixin library jar in the "External Libraries" section of the "Project" section:

Mixin Library

You will need to copy the jar's "Absolute Path" for the next step.

2. Add the -javaagent VM argument.

In your "Minecraft Client" and or "Minecraft Server" run configuration, add the following to the VM Arguments option:

-javaagent:"path to mixin library jar here"

VM Arguments Screenshot

Now, you should be able to modify the contents of your mixin methods during debugging and have the changes take effect without restarting the game.