-
Notifications
You must be signed in to change notification settings - Fork 0
Best Practices Troubleshooting
DarkBladeDev edited this page May 10, 2026
·
3 revisions
id=your_addon
version=1.0.0
main=com.yourorg.youraddon.YourAddon
api=1
depends=another_addonimport dev.darkblade.mbe.api.addon.AddonContext;
import dev.darkblade.mbe.api.addon.AddonException;
import dev.darkblade.mbe.api.addon.MultiblockAddon;
public final class YourAddon implements MultiblockAddon {
private AddonContext ctx;
@Override public String getId() { return "your_addon"; }
@Override public String getVersion() { return "1.0.0"; }
@Override
public void onLoad(AddonContext ctx) throws AddonException {
this.ctx = ctx;
// Registrations (actions/conditions/matchers)
}
@Override
public void onEnable() throws AddonException {
// Code-defined multiblocks / listeners
}
@Override
public void onDisable() {
// Cleanup
}
}- Register as much as possible in
onLoadto fail early. - Use
AddonExceptionfor fatal failures with clear context. - Keep domain logic out of the core: everything stays inside your addon.
- Use
@InjectServicefor clean dependency access. - Do not assume load order unless you declare
depends.
- Check that
addon.propertiesexists inside the JAR. - Ensure
id,version,main, andapiare correct. - Verify that
mainimplementsMultiblockAddon.
- Set
apiinaddon.propertiesto the current engine version (usually1).
- Actions/Conditions must start with
addonId:. - Matchers: the prefix must be exactly
addonId. - Code-defined multiblocks:
createMultiblock("name")is recommended.