Back to mods
inject project artwork

Modrinth · Minecraft mod

inject

A library for making injecting into Netty easier!

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which inject release matches 26.1.2?

Updated 4 months ago
Best match for your filters 3.2.0
Game version 1.21, 1.21.1, 1.21.10
Loader folia, paper, purpur

inject 3.2.0 targets 1.21, 1.21.1, 1.21.10 with folia, paper, purpur. Do not install it on the client. It must be installed on the dedicated server. No extra mods listed for this file.

Where it goes

Is inject required on the client, server, or both?

Do not install it on the client. It must be installed on the dedicated server.

Client Not supported
Dedicated server Required
Loader for this release folia, paper, purpur
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

This file is marked server-only.

What else does inject 3.2.0 need?

3.2.0 on 26.1.2. Every mod below is checked against that same setup.

No extra mods listed for this file

This file does not list any required mods. Do not add a library just because a different file uses it.

This file does not list any required or optional mods.

Before you install it

Add inject without breaking your instance.

Built for inject 3.2.0 on 26.1.2. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use 3.2.0. It targets 1.21, 1.21.1, 1.21.10 with folia, paper, purpur; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    This file does not list any required mods. Do not add a library just because a different file uses it.

  3. 03

    Put it on the correct side

    Do not install it on the client. It must be installed on the dedicated server.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside 3.2.0. It opens that exact file at the source.

About this project

What does inject add?

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 Brawls 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.

Project description from Modrinth.

Pick your setup

inject by Minecraft version and loader

Choose the version and loader you play, then open the matching release.

32 available setups

Showing the newest 12 of 16 game versions. Older files are in the list below.

Check the dependencies, then try the file in a copied instance before changing a world you care about.

Recent files

inject versions and loaders

2 of 14 releases match
Clear filters

Looking for an older file? The official Modrinth project page is in Resources.