Creating a new mod

After all that setup, you can now create your first mod!

To do this, open up a terminal where you want to create your project and run:

geode new

Follow the given prompts and afterwards you should have a new folder containing the code for your mod.

Files

You may notice the project already comes with a few files. Lets go over them:

If you plan on releasing your mod, please edit the about.md and logo.png files!

The source code for your mod can be found inside the src folder.

Additional Files

Geode will also look for these special files within your mod folder:

Build

Now, to build your mod you have a few options:
If youre using an IDE such as Clion, VScode or Visual Studio, head over to the IDE Setup page.

If you’re building for android, check out the android section.

Otherwise if you want to build your mods manually from the command line you can do that by simply running these commands in your mod’s folder:

# Configures & builds for the current platform
geode build

Check out geode build --help for other options!

If you have an issue running that command for whatever reason (let us know!), you can build your mod the same way using these commands:

# Configure CMake
cmake -B build

# Build the project
cmake --build build --config RelWithDebInfo

If you created a profile in CLI, then the mod should be automatically copied over to your mods folder, if not, then the built your.mod.geode file should be in your build folder.

Build for Android

To build mods for android you must install the Android NDK.
Extract it somewhere and set the ANDROID_NDK_ROOT enviroment variable to its path.

On Windows you must also install ninja. You can do this via scoop scoop install ninja

Now you can build your mod for android by just doing:

geode build -p android64
# or if you're using a 32 bit phone
geode build -p android32

You can then copy the built .geode file from the build-android64 folder to your phone at this location:

/storage/emulated/0/Android/media/com.geode.launcher/game/geode/mods/