inject

inject

A library for making injecting into Netty easier!

by
1.4K Downloads
fabricfoliapaperpurpurspigotlibrarytechnology
Rent Server with this Mod

About this Mod

inject

Inject is a simple server-side library to allow developers to inject into Netty easier.

Example

This uses the HttpInjector class to respond to HTTP requests to the Minecraft
server.

class MyEpicHttpInjector extends HttpInjector {
    @Override
    public HttpByteBuf intercept(ChannelHandlerContext ctx, HttpRequest request) {
        HttpByteBuf buf = HttpByteBuf.httpBuf(ctx);
        buf.writeStatusLine("1.1", 200, "OK");
        buf.writeText("Hello, from Minecraft!");
        return buf;
    }
}

Registration

For Fabric, use the InjectFabric class:

public class MyMod implements ModInitializer {
    @Override
    public void onInitialize() {
        InjectFabric.INSTANCE.registerInjector(new MyEpicHttpInjector());
    }
}

For Spigot, Paper and derivatives, use the InjectSpigot class:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {
        InjectSpigot.INSTANCE.registerInjector(new MyEpicHttpInjector());
    }
}

This will register an HTTP injector which will respond with Hello, from Minecraft!
to any HTTP request to the Minecraft port.

$ curl http://localhost:25565
Hello, from Minecraft!

Supported web servers

  • Spring Boot: spring module
  • Javalin: javalin module
  • Ktor: ktor module
  • Jetty: jetty module
  • manual request handling: http module

Examples can be found in the examples module.

Usage

Add the andante repo to gradle:

repositories {
    maven("https://maven.mcbrawls.net/releases/")
}

Add the dependency:

dependencies {
    implementation("net.mcbrawls.inject:api:VERSION")
 
    // For HTTP-related things:
    implementation("net.mcbrawls.inject:http:VERSION")

    // Fabric:
    include(modImplementation("net.mcbrawls.inject:fabric:VERSION")!!)
 
    // Spigot/Paper:
    implementation("net.mcbrawls.inject:spigot:VERSION")

    // You can find the other modules for Spring, Ktor, etc. on the Github repo.
}

Replace VERSION with the latest version from the releases tab.

Available Versions

Inject 3.1.4release
MC 1.21.1, 1.21.2, 1.21.3, 1.21.4folia, paper, purpur, spigot
May 17, 2025
Inject 3.1.4release
MC 1.21.1, 1.21.2, 1.21.3, 1.21.4fabric
May 17, 2025
Inject 3.1.3release
MC 1.21.1, 1.21.2, 1.21.3, 1.21.4fabric
March 17, 2025
Inject 3.1.1release
MC 1.21.1, 1.21.2, 1.21.3, 1.21.4fabric
December 20, 2024
Inject 3.0.0release
MC 1.21.1, 1.21.2, 1.21.3, 1.21.4spigot
December 12, 2024

How to Install inject 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.4).

3

Install Mod

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

Compatibility

Mod Loaders

fabricfoliapaperpurpurspigot

Minecraft Versions

1.21.4, 1.21.3, 1.21.2 (+2 more)

Server-side

Required

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

inject 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.4). You can switch loaders with one click in the panel.

Is inject compatible with fabric and folia and paper and purpur and spigot?

inject officially supports fabric, folia, paper, purpur, spigot for Minecraft 1.21.4, 1.21.3, 1.21.2. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with inject – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if inject 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 inject 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
Required

Supported Versions

1.21.41.21.31.21.21.21.11.21