close
EnderDash
Reference

Java API

Add the EnderDash Java API to a Java plugin or integration.

Source of truth

The hosted Javadocs are the source of truth for the public Java API.

If this page and the Javadocs are different, follow the Javadocs.

Add to your build file

The artifact is available from Maven Central. You do not need a custom repository.

For Maven, use the provided scope. For Gradle, use the compileOnly configuration.

The agent provides the API while the server runs. Do not include the API in your plugin jar.

Replace VERSION with a released version that your plugin supports.

<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

The EnderDash agent must load before your plugin calls EnderDashApi.get(). Add a soft dependency to your plugin descriptor.

The soft dependency controls the load order. Your plugin can load without EnderDash, but it cannot use the EnderDash API.

Add to plugin.yml:

softdepend: [ "EnderDash" ]

Minimal integration example

The agent registers one API instance when the plugin starts.

Get this instance through 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());
  }
}

If the agent is not available, EnderDashApi.get() throws an error.

Notes

  • Use a released version instead of a snapshot.
  • Agent keys are not part of Java API authentication.
  • For scripts or dashboards, use the HTTP API.

Was this page helpful?

Send a quick note if anything is missing or unclear.

Last updated on

On this page