Minecraft gameplay modifications for server admins who know Java
Find a file
2025-09-02 21:26:14 -05:00
gradle/wrapper Update gradle 2025-03-29 16:45:03 -05:00
src/main Push local changes 2025-09-02 21:26:14 -05:00
.gitignore Initial commit 2024-12-27 18:02:33 -06:00
build.gradle Commands 2025-04-19 03:47:27 -05:00
gradle.properties Push local changes 2025-09-02 21:26:14 -05:00
LICENSE.txt Initial commit 2024-12-27 18:02:33 -06:00
README.md wow i forgor again! 2025-04-15 08:50:44 +00:00
settings.gradle Initial commit 2024-12-27 18:02:33 -06:00
todo.md Initial commit 2024-12-27 18:02:33 -06:00

Nema

A module loader for Fabric servers, with an explicit focus on hot-reloading. Designed for a server admin who wants to add custom gameplay elements to their server and knows Java, but hates restarting the server constantly. (me)

Module Development

Create a Gradle project with Minecraft and the Yarn mappings as dependencies (Fabric API not required for modules).

Your build.gradle should have this in it:

repositories {
    maven { url "https://git.sulfrix.com/api/packages/Sulfrix/maven" }
}

dependencies {
    // To change the versions use the gradle.properties file
    minecraft "com.mojang:minecraft:${project.minecraft_version}"
    mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"

    modImplementation "com.sulfrix:nema:+"
}

Create a class that extends NemaModule:

public class TestModule extends NemaModule {
	
	public static TestModule instance;

	@Override
	public void load() {
		// Initialize your module, add any event handlers and schedules
		RegisterEvents(new Events());
		instance = this;
	}

	@Override
	public void unload() {
		// Undo any modifications made to game state, if needed
	}
}

Event Listening

Events work in a similar way to Bukket/Spigot/Paper. Create a class that extends EventListener and use the @EventHandler annotation on methods.

public class Events extends EventListener {
    @EventHandler
    public void OnDamage(DamageEvent event) {
        // Do something when an entity takes damage
    }
}

Be sure to register your events class in your module's load() method. Event listeners are unloaded automatically when the module unloads.