Skip to content

Using BedWars API

Use the BedWars API to interact with and extend the functionality of the BedWars plugin.

Warning

The API is still evolving. Breaking changes will be introduced in future versions, starting from 0.3.0.

Installation

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<repositories>
  <repository>
    <id>screaming-repo</id>
    <url>https://repo.screamingsandals.org/public/</url>
  </repository>
</repositories>

<dependencies>
  <dependency>
    <groupId>org.screamingsandals.bedwars</groupId>
    <artifactId>BedWars-API</artifactId>
    <version>0.2.39</version>
    <scope>provided</scope>
  </dependency>
</dependencies>
1
2
3
4
5
6
7
repositories {
    maven { url 'https://repo.screamingsandals.org/public/' }
}

dependencies {
    compileOnly 'org.screamingsandals.bedwars:BedWars-API:0.2.39'
}
1
2
3
4
5
6
7
repositories {
    maven(url = uri("https://repo.screamingsandals.org/public/"))
}

dependencies {
    compileOnly("org.screamingsandals.bedwars:BedWars-API:0.2.39")
}

If you prefer or need access to the entire plugin (including internals not exposed via the API), you can also depend on the main BedWars plugin instead of BedWars-API. However, this approach is discouraged because internal classes and methods may change at any time and without notice.

Hooking into the API

Once included in your build, you can access the API using:

1
2
3
4
5
import org.screamingsandals.bedwars.api.BedwarsAPI;

...
BedwarsAPI api = BedwarsAPI.getInstance();
...

Javadoc: https://docs.screamingsandals.org/BedWars/javadoc/0.2.39/