Skip to content

API tutorial

Daniel Saukel edited this page Nov 2, 2021 · 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-PRE-02</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>dre-repo</id>
            <url>https://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;

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