CrashDetector extensions are normal Java JAR files that add features to CrashDetector.
An extension can register new checks, GUI panels, buttons, log destinations, APIs, language overrides, app-side hooks, or other CrashDetector integrations.
The extension system is intentionally simple. A CrashDetector extension is just:
- A normal
.jarfile - A class that implements
com.asbestosstar.crashdetector.Extencion - A manifest entry named
ExtencionCrashDetectorthat points to that class
Example manifest entry:
ExtencionCrashDetector: com.asbestosstar.crashdetector_tutorial_extention_english.TutorialExtention
Your extension needs CrashDetector on the compile classpath.
Current Maven artifact:
com.asbestosstar:crashdetector:0.9.4
Maven Central location:
https://repo1.maven.org/maven2/com/asbestosstar/crashdetector/0.9.4/
Use your normal build system to add that dependency. Gradle, Maven, and other Java build tools are fine.
The CrashDetector dependency should normally be compile-only/provided. Do not bundle CrashDetector inside your extension JAR.
Create a class that implements Extencion.
package com.asbestosstar.crashdetector_tutorial_extention_english;
import com.asbestosstar.crashdetector.CrashDetectorLogger;
import com.asbestosstar.crashdetector.Extencion;
public class TutorialExtention implements Extencion {
@Override
public void procesoDelApp() {
CrashDetectorLogger.log("[TutorialExtention] Loaded in app process");
}
@Override
public void procesoDeLaMonitorizacionDePID() {
CrashDetectorLogger.log("[TutorialExtention] Loaded in monitor process");
}
}The class name in the manifest must be the full package and class name:
com.asbestosstar.crashdetector_tutorial_extention_english.TutorialExtention
CrashDetector has two important processes.
This method runs inside the application/game process.
Use this method for app-side features, such as:
- patches
- transformers
- prelaunch hooks
- app/game process setup
- loader-related integrations
This is similar in purpose to systems like:
- Java agents
- FeatureCreep agents
- ModLauncher
ITransformationService - Fabric Loader
PreLaunchEntrypoint
Not every loader supports the same kind of transformation system. For example, Fabric by itself does not provide the same transformation model as ModLauncher unless something like SpongeMixin or FeatureCreep is involved.
This method runs inside the CrashDetector monitor process.
Use this method for CrashDetector-side features, such as:
- registering verifications
- registering GUI panels
- adding sidebar buttons
- adding APIs
- adding log destinations
- registering language overrides
- adding report or analysis tools
This process is separate from the app/game process. Do not assume that objects from the app process are available here.
Your JAR must contain this manifest entry:
ExtencionCrashDetector: your.full.ExtensionClassName
Example:
ExtencionCrashDetector: com.asbestosstar.crashdetector_tutorial_extention_english.TutorialExtention
CrashDetector reads this exact manifest key. If the entry is missing or misspelled, the JAR will not be loaded as an extension.
Correct:
ExtencionCrashDetector
Incorrect:
ExtensionCrashDetector
CrashDetectorExtension
Extencion
The output should be a normal .jar file.
CrashDetector extensions do not need a special file format. If the manifest entry is present, CrashDetector can detect the JAR as an extension.
The extension file may use one of the supported extension file endings recognized by CrashDetector, but the normal and recommended output is simply:
your-extension-name.jar
Use valid Java package names.
Good:
com.asbestosstar.crashdetector_tutorial_extention_english
Bad:
com.asbestosstar.crashdetector-tutorial-extention-english
Hyphens are not valid in Java package names. Use underscores if needed.
Build the extension JAR and place it somewhere CrashDetector will scan as part of the mod list.
When CrashDetector sees the JAR, it checks the manifest. If it finds ExtencionCrashDetector, it loads the class and calls the appropriate method for the current process.
A simple first test is to log from both methods:
@Override
public void procesoDelApp() {
CrashDetectorLogger.log("[MyExtension] app process loaded");
}
@Override
public void procesoDeLaMonitorizacionDePID() {
CrashDetectorLogger.log("[MyExtension] monitor process loaded");
}Then run CrashDetector and check the logs.
Depending on the environment, you may see one or both messages. The app process and monitor process load at different times.
If the JAR does not contain ExtencionCrashDetector, CrashDetector will ignore it.
This will not work:
ExtencionCrashDetector: TutorialExtention
Use the full class name:
ExtencionCrashDetector: com.asbestosstar.crashdetector_tutorial_extention_english.TutorialExtention
The target class must implement:
com.asbestosstar.crashdetector.ExtencionThe extension should normally compile against CrashDetector but not include CrashDetector inside its own JAR.
Use the equivalent of compileOnly or provided, depending on your build system.
procesoDelApp() and procesoDeLaMonitorizacionDePID() run in different processes.
Do not rely on static fields, singleton instances, or in-memory objects being shared between them.
Some app-side hooks may work differently depending on the launcher, loader, or Java environment.
Monitor-side features are usually easier to make portable.
Before testing, confirm:
- The project compiles against
com.asbestosstar:crashdetector:0.9.4 - The extension class implements
Extencion - The extension class has a public no-argument constructor
- The JAR manifest contains
ExtencionCrashDetector - The manifest value is the full class name
- CrashDetector is able to see the JAR in its scanned mod list
Manifest:
ExtencionCrashDetector: com.asbestosstar.crashdetector_tutorial_extention_english.TutorialExtention
Class:
package com.asbestosstar.crashdetector_tutorial_extention_english;
import com.asbestosstar.crashdetector.CrashDetectorLogger;
import com.asbestosstar.crashdetector.Extencion;
public class TutorialExtention implements Extencion {
@Override
public void procesoDelApp() {
CrashDetectorLogger.log("Tutorial extension loaded in app process");
}
@Override
public void procesoDeLaMonitorizacionDePID() {
CrashDetectorLogger.log("Tutorial extension loaded in monitor process");
}
}That is enough for a basic CrashDetector extension.