Skip to content

API tutorial

Daniel Saukel edited this page Apr 1, 2020 · 13 revisions

DungeonsXL has, as of v0.18, an API module that will allow for programming stable hooks.


  1. How to get the API
  2. Hooking into DXL

How to get the API

The DungeonsXL API can be built from source or downloaded from the Maven repository.

    <dependencies>
        <dependency>
            <groupId>de.erethon.dungeonsxl</groupId>
            <artifactId>dungeonsxl-api/artifactId>
            <version>0.18-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>dre-repo</id>
            <url>http://erethon.de/repo</url>
        </repository>
    </repositories>

Alternatively, binaries can be downloaded manually here.

Hooking into DXL

The main class of the API is the DungeonsAPI singleton.


DungeonsAPI dxl;

void loadDungeonsAPI() {
    if (!Bukkit.getPluginManager().isPluginEnabled("DungeonsXL")) return;
    dxl = (DungeonsAPI) Bukkit.getPluginManager().getPlugin("DungeonsXL");
}
Clone this wiki locally