Build Your First Plugin
Create a working SoulFire plugin from the official template and load it into SoulFire as a Fabric mod.
This guide takes the shortest path to a real plugin. It uses the official template instead of starting from an empty Fabric project, because the template already includes the SoulFire-specific wiring.
The official template repository is SoulFirePluginExample. Treat it as your starting scaffold, then cross-check the current Javadocs and current SoulFire source for low-level APIs.
Before you start
- Install Java 25.
- Install Git.
- Use IntelliJ IDEA if possible. It is the least painful option for Fabric Loom, Mixins, and Java plugin work.
- Have a working SoulFire install where you can test jars in
minecraft/mods.
Create the project
Clone the template
git clone https://github.com/AlexProgrammerDE/SoulFirePluginExample.git my-soulfire-plugin
cd my-soulfire-pluginRename the plugin metadata
Update these files first:
settings.gradle.ktsbuild.gradle.ktsgradle/libs.versions.tomlsrc/main/resources/fabric.mod.json- the Java package under
src/main/java
Make your plugin ID lowercase and hyphenated.
Reuse the same ID consistently in PluginInfo, fabric.mod.json, settings namespaces, mixin config names, and access widener names.
Keep the Fabric entrypoint
SoulFire plugins are Fabric mods, so the JVM entrypoint is still a normal ModInitializer:
package com.example.myplugin;
import com.soulfiremc.server.api.SoulFireAPI;
import net.fabricmc.api.ModInitializer;
public final class Main implements ModInitializer {
@Override
public void onInitialize() {
SoulFireAPI.registerServerExtension(new MyPlugin());
}
}SoulFireAPI.registerServerExtension(...) is the moment your plugin becomes visible to SoulFire.
Implement the plugin class
For external plugins, extend ExternalPlugin and provide PluginInfo:
package com.example.myplugin;
import com.soulfiremc.server.api.ExternalPlugin;
import com.soulfiremc.server.api.PluginInfo;
import com.soulfiremc.server.api.event.bot.BotConnectionInitEvent;
import lombok.extern.slf4j.Slf4j;
import net.lenni0451.lambdaevents.EventHandler;
@Slf4j
public final class MyPlugin extends ExternalPlugin {
public MyPlugin() {
super(new PluginInfo(
"my-plugin",
"1.0.0",
"Example SoulFire plugin",
"YourName",
"MIT",
"https://example.com"
));
}
@EventHandler
public void onBotInit(BotConnectionInitEvent event) {
log.info("Bot {} was initialized", event.connection().accountName());
}
}Install it into SoulFire
Copy the jar into SoulFire's Fabric mods directory and restart SoulFire:
- integrated GUI or CLI install:
soulfire/minecraft/mods - dedicated server install:
minecraft/modsnext to the server jar
Add settings and a plugin page
The official example plugin shows the standard pattern:
- create a
SettingsObjectclass withpublic static finalproperties - listen for
InstanceSettingsRegistryInitEvent - call
event.settingsPageRegistry().addPluginPage(...) - read values through
connection.settingsSource()
That makes your settings appear in the GUI, CLI, and exported instance metadata automatically.
Verify that it loaded
Use the built-in plugin inspection tools:
- open the instance UI and check Plugins
- run
pluginsin the terminal - run
print-docs pluginsif you want the current built-in plugin documentation output
If the mod failed before registration, check the startup logs first.
Fabric loading problems, missing dependencies, and bad mixin config usually fail before SoulFire ever sees your ExternalPlugin.
What to do next
- Environment Setup to align your IDE and source checkout
- Gradle And Project Layout for the important build files
- Event System to choose the right hook
- Mixins And Access Wideners if events are not enough
How is this page?
Last updated on