CT Loader / mods

Mods

CT Loader looks for mod JARs in the mods directory inside the configured game directory, validates each ct.mod.json, checks required dependencies, and invokes every initialization entrypoint in dependency order before Minecraft starts. CT Loader itself is the ctloader module — add it to the modules folder and its jar rides along on the game classpath.

Start here

How to open the mods folder

The mods folder is always <game directory>/mods/. With the default settings the game directory is ~/.ct-client/game, so the full default path is ~/.ct-client/game/mods/.

The table below shows the default path expanded for each operating system, where <name> is your user account name:

PlatformDefault mods folder
macOS/Users/<name>/.ct-client/game/mods
Windows%USERPROFILE%\.ct-client\game\mods
Linux/home/<name>/.ct-client/game/mods

.ct-client is a hidden folder on every platform: on macOS and Linux its name begins with a dot, and Windows treats a dot-prefixed folder in your home directory the same way. That is why it does not appear in a normal file listing. Each platform has a quick way to reach it anyway.

macOS

Use Finder's Go > Go to Folder (Cmd+Shift+G) and paste the path, or open the folder straight from Terminal:

open ~/.ct-client/game/mods

You can also reveal the application folder in Finder first with open ~/.ct-client, then navigate into game/mods.

Windows

Paste the path directly into the File Explorer address bar and press Enter:

%USERPROFILE%\.ct-client\game\mods

Or open the folder from Command Prompt or PowerShell:

explorer %USERPROFILE%\.ct-client\game\mods

Linux

Press Ctrl+L in your file manager and type the path, or open the folder from a terminal:

xdg-open ~/.ct-client/game/mods

Custom game directory: if game.directory was changed in the settings, the mods folder lives under that directory instead — it is always <game directory>/mods/, never fixed to ~/.ct-client. The command line --game-dir flag changes it for a single run. See the CLI reference.

CT creates the mods/ directory automatically on launch, so you can also start CT once and then open the folder. To create it yourself:

mkdir -p ~/.ct-client/game/mods

Place each mod JAR directly inside the folder. CT scans only the top level of mods/ — JARs in subdirectories are not discovered.

Installing

Install a CT mod

Four steps from a downloaded JAR to a loaded mod.

  1. 1
    Open the mods folder. Follow the section above — by default ~/.ct-client/game/mods/, or <game directory>/mods/ with a custom game.directory.
  2. 2
    Drop the mod JAR in. Place the JAR directly inside mods/, not in a subfolder. CT creates the folder automatically on launch if it does not exist yet.
  3. 3
    Verify the JAR contents. The JAR must contain a ct.mod.json file at its root. A JAR without it is not a CT mod and is skipped by the scan.
  4. 4
    Launch CT. CT Loader scans mods/, validates every ct.mod.json, checks required dependencies, and initializes entrypoints in dependency order before invoking Minecraft's official main class. Any problem is reported in the CT output.
Metadata

ct.mod.json, schema 1

Every CT mod JAR must contain a ct.mod.json file at its root. The first schema supports required dependencies and one or more Java entrypoints.

{
  "schemaVersion": 1,
  "id": "example",
  "name": "Example Mod",
  "version": "1.0.0",
  "entrypoints": ["example.ExampleMod"],
  "depends": []
}
FieldTypeMeaning
schemaVersionnumberFormat version. 1 is the only schema CT currently reads.
idstringUnique mod identifier. Duplicate IDs across installed mods are rejected and stop the launch.
namestringHuman-readable display name shown in CT output.
versionstringThe mod's own version string, reported with the mod.
entrypointsarrayOne or more fully qualified Java class names to initialize. Each class must be public with a public no-argument constructor and implement com.ct.module.ctloader.CTMod.
dependsarrayOptional array of required CT mod IDs. Every listed ID must be installed, or the launch stops with an error.

A malformed ct.mod.json — missing fields, unreadable JSON, or an invalid entrypoint reference — stops launch with an error in the CT output rather than silently skipping the mod.

Code

The entrypoint class

An entrypoint is a public class with a public no-argument constructor that implements com.ct.module.ctloader.CTMod.

package example;

import com.ct.module.ctloader.CTMod;
import com.ct.module.ctloader.CTModContext;

public final class ExampleMod implements CTMod {
    @Override
    public void onInitialize(CTModContext context) {
        context.log("Example Mod initialized");
    }
}

onInitialize(CTModContext) runs once, before Minecraft's main class, for every entrypoint listed in ct.mod.json. The CTModContext handed to your entrypoint exposes:

  • Metadata — the parsed ct.mod.json of your mod, including its id, name, and version.
  • Game directory — the configured game directory, for reading or writing your own files under it.
  • Mods directory — the mods/ folder the loader scanned, so you can see the other installed mod JARs.
  • Mod-ID-prefixed logger — context.log(...) writes to CT output with your mod's id as the prefix, so messages are attributable.

An entrypoint that throws stops the launch with the exception reported in the CT output. There is no partial initialization: a failing mod fails the launch.

Validation

Dependencies and loader rules

The optional depends array contains required CT mod IDs, and CT enforces a strict set of rules before any entrypoint runs.

  • Required dependencies must be present. Every ID in depends must be installed as a CT mod in mods/. A missing dependency stops the launch with an error naming what is absent.
  • Duplicate IDs are rejected. Two installed mods may not declare the same id.
  • Dependency cycles are rejected. Mods that depend on each other, directly or transitively, cannot be ordered and stop the launch.
  • Dependencies initialize first. Entrypoints run in dependency order, so a mod's dependencies are always initialized before the mod that requires them.
  • A malformed mod stops the launch. Unreadable or invalid ct.mod.json fails the launch instead of being skipped.
  • A failed entrypoint stops the launch. An exception thrown from onInitialize is reported in the CT output and the game does not start.

All checks run before Minecraft's main class is invoked, so a broken mod set never reaches the game.

Other loaders

Fabric mod detection

CT detects Fabric mod JARs in the game mods/ folder and routes the launch to an installed Fabric profile automatically.

When a JAR containing a root-level fabric.mod.json is present in mods/, CT checks the installed profiles and automatically uses the sole installed Fabric profile matching the selected Minecraft version:

  • No matching profile — install Fabric Loader into the same game directory using its official installer, then refresh the profile list. CT reports when Fabric Loader must be installed or a profile selected.
  • Several matching profiles — CT cannot choose for you; select one explicitly in the desktop launcher.

CT does not download or repair loader files, and the external loader — not CT's native API — loads its mods. The same handoff covers Forge and NeoForge profiles installed by their own installers. CT installs the profile's required vanilla Minecraft parent version when it is missing, but loader installation and loader-library repair remain the responsibility of that loader's installer. Profile launching is currently desktop-only; the command line interface continues to install and launch vanilla versions.

Security

Trust

Security warning: mods are executable Java code. Loading a mod runs its entrypoints with the same privileges as CT and the game, and mods are not sandboxed by CT in any way. Only install mod JARs you trust.

This applies equally to CT mods with ct.mod.json and to Fabric mods with fabric.mod.json — in both cases the JAR contains code that executes on your machine with your permissions. Review the source or the publisher before dropping an unknown JAR into mods/. See Security for CT's overall trust model.

Related

Related pages

01 / SETUP

Beginner guide

The short plain-language track from download to playing.

02 / API

CT mod API

CTMod, CTModContext, CTModLoader, and CTLoaderBootstrap.

04 / HELP

Troubleshooting

Launch stopped with a mod error? Check the mapped causes and fixes.

05 / ARCH

Architecture

How CT Loader fits into the launch pipeline.

06 / DOWNLOAD

Release

Download CT v4.3.0 and read the update notes.