API
How to use our API

Add the plugin as a dependency:

Gradle
Maven
Manual
1
repositories {
2
maven {
3
url = uri('https://repo.codemc.org/repository/maven-public/')
4
}
5
}
6
7
dependencies {
8
compileOnly 'me.Lorenzo0111:RocketPlaceholders:VERSION'
9
}
Copied!
1
<repositories>
2
<repository>
3
<id>codemc-repo</id>
4
<url>https://repo.codemc.org/repository/maven-public/</url>
5
</repository>
6
</repositories>
7
8
<dependencies>
9
<dependency>
10
<groupId>me.Lorenzo0111</groupId>
11
<artifactId>RocketPlaceholders</artifactId>
12
<version>VERSION</version>
13
<scope>provided</scope>
14
</dependency>
15
</dependencies>
Copied!
Download this and add it as dependency.
Replace version with
.

Get the API

1
RocketPlaceholdersAPI api = Bukkit.getServicesManager().load(RocketPlaceholdersAPI.class);
2
if (api != null) {
3
this.getLogger().info("RocketPlaceholders hooked!");
4
} else {
5
this.getLogger().severe("Unable to find RocketPlaceholdersAPI, disabling..");
6
this.getServer().getPluginManager().disablePlugin(this);
7
}
Copied!

How to add a placeholders

Without permissions nodes

1
this.getAPI().addPlaceholder(new PlaceholderBuilder("identifier", "text"));
Copied!

With permissions nodes

1
this.api.addPlaceholder(new PlaceholderBuilder(new PlaceholderBuilder("identifier", "text").createPermissionNode("permission.example", "secret text"));
Copied!

How to get all placeholders

Internal placeholders

1
this.getAPI().getInternalPlaceholders().getStorageManager().getInternalPlaceholders();
Copied!

External placeholders

1
this.getAPI().getInternalPlaceholders().getStorageManager().getExternalPlaceholders().getHashMap();
Copied!
Placeholders added via API won't synchronized with MySQL

Cookbook

Click here to view our cookbook.
Last modified 3mo ago