Java API
Reference for consuming the public EnderDash Java API from a Java plugin or integration.
Source of truth
Use the hosted Javadocs as the primary source of truth for the public Java surface.
- Maven Central artifact: Central Sonatype / MVNRepository
- Javadocs:
javadoc.io/doc/com.enderdash/enderdash-api
If this page and the Javadocs ever disagree, trust the Javadocs.
Add to your build file
The artifact is published to Maven Central, so no custom repository is needed. Use the provided (Maven) or compileOnly (Gradle) scope: the agent ships the API on its classpath at runtime, so you should not bundle it into your plugin jar. Replace VERSION with the released version you want to target.
<dependencies>
<!-- EnderDash API -->
<dependency>
<groupId>com.enderdash</groupId>
<artifactId>enderdash-api</artifactId>
<version>VERSION</version>
<scope>provided</scope>
</dependency>
</dependencies>Add EnderDash as a plugin dependency
For EnderDashApi.get() to return a registered instance, the EnderDash agent must load before your plugin's onEnable. Declare EnderDash as a (soft) dependency in your plugin descriptor so the loader orders it for you. A soft dependency lets your plugin still load when EnderDash is missing; only API calls will fail.
Add to plugin.yml:
softdepend: [ "EnderDash" ]Minimal integration example
The active agent registers itself as a singleton during plugin enable. Resolve it via the static accessor:
import com.enderdash.agent.api.EnderDashApi;
public final class EnderDashIntegration {
public void onEnable() {
EnderDashApi api = EnderDashApi.getOrNull();
if (api == null) {
// EnderDash plugin not loaded yet, defer your lookup.
return;
}
System.out.println("EnderDash API " + api.getApiVersion() + " on server " + api.getServerId());
}
}Use EnderDashApi.get() if you would rather fail loudly when the agent is missing.
Notes
- Pin a released version instead of tracking moving snapshots.
- Agent keys are not part of Java API authentication.
- If you need HTTP endpoints for scripts or dashboards, use HTTP API instead.
Was this page helpful?
Send a quick note if anything is missing or unclear.
Last updated on