ctjs

ctjs

An in-progress rewrite of the ChatTriggers mod in Fabric 1.21

by
21.7K Downloads
fabricforge
Rent Server with this Mod

About this Mod

NOTE

This project is a fork from the original mod, for the original github you can head over to https://github.com/ChatTriggers/ctjs

ChatTriggers (CT) is a framework for Minecraft that enables live scripting and client modification using JavaScript. We provide libraries, wrappers, objects, and more to make your life as a modder as easy as possible. Even if we don't support something you need, you can still access any Java classes and native fields/methods.

With CT, you have all the power of a modding environment with the benefit of an easy-to-use language and the ability to reload your scripts without restarting the game. CT also provides a way to define your own Mixins!

CT is currently written for Fabric 1.21.x. See this repo for the deprecated Forge 1.8.9 version.

Examples

Want to hide an annoying server message that you see every time you join a world?

register('chat', event => {
    cancel(event);
}).setCriteria("Check out our store at www.some-mc-server.com for 50% off!");

How about automating a series of common commands into one?

register('command', () => {
    ChatLib.command('command1');
    ChatLib.command('command2');
    ChatLib.command('command3');
}).setName('commandgroup');

Or even something silly like a calculator command

register('command', (...args) => {
    // Evaluate all args the user gives us...
    const result = new Function('return ' + args.join(' '))();

    // ...and show the result is a nice green color
    ChatLib.chat(`&aResult: ${result}`);
}).command('calc');

With CT's register system, you can listen to custom events that we emit and react to them. For example, we emit events when you switch worlds, click on a GUI, hit a block, hover over an item and see its tooltip, and much more! You can even provide custom events for other module authors to use.

Getting Started

To begin, download and install Fabric for one of the supported versions, then head over to our releases page and download the latest version. The mod is installed like any mod; just drag it into your mods folder. Once installed, you can import modules in-game by typing /ct import <moduleName>, where <moduleName> is the name of the module. You can browse the available modules on our website.

Writing Modules

If you can't find any modules on the website that do exactly what you want, which is quite likely, you'll have you write your own! Here are the steps you'll want to take:

  1. Navigate to the .minecraft/config/ChatTriggers/modules folder. If you don't know where this is, you can also execute /ct files, which will open the correct directory automatically.

  2. Create a new directory with the name of your module

  3. Inside the directory, create a file called metadata.json, and inside of that, put the following text:

    {
        "name": "<module name>",
        "entry": "index.js"
    }
    

    This means that when our module first runs, CT will run the index.js file

    Note that <module name> must match the name of your folder exactly!

  4. Create the index.js file, and put some code in there. What exactly you write will depend on what you want CT to do. To learn more about the available APIs, take a look at the Slate.

    • Some things on the Slate may be outdated, we are working on improving this

Documentation

Available Versions

2.2.2-1.8.9release
MC 1.8.9forge
October 26, 2025

How to Install ctjs on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set fabric Loader

In the panel under "Egg", select the fabric loader and matching Minecraft version (1.21.11).

3

Install Mod

Open the mod browser in the dashboard and search for "ctjs". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

fabricforge

Minecraft Versions

1.21.11, 1.21.10, 1.21.9 (+6 more)

Server-side

Unsupported

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

ctjs server crashes on startup – what to do?

Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.21.11). You can switch loaders with one click in the panel.

Is ctjs compatible with fabric and forge?

ctjs officially supports fabric, forge for Minecraft 1.21.11, 1.21.10, 1.21.9. Note: Forge and Fabric mods are NOT cross-compatible – pick one loader and stick with it. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with ctjs – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if ctjs consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install ctjs with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
MIT License
Server-side
Unsupported

Supported Versions

1.21.111.21.101.21.91.21.81.21.71.21.61.21.51.21.41.8.9