Lorenzo0111's Plugins
Discord
Lorenzo0111's Plugins
Lorenzo0111's Plugins
  • Home
  • RocketJoin
    • Starting
    • Configure
    • Conditions
      • Permission
      • First Join
    • Join Commands
    • Bungeecord
  • RocketPlaceholders
    • Starting
    • Configure
      • Custom Conditions
        • JavaScript Condition
        • Money Condition
        • Item Condition
        • Permission Condition
        • Group Condition
      • Custom Permissions
    • MySQL
      • MySQL F.A.Q
    • API
    • Dev Builds
  • MultiLang
    • Starting
    • Configuration
    • Translating
    • Messages
    • Gui
    • RealTime
Powered by GitBook
On this page
  • Add the plugin as a dependency:
  • Get the API
  • How to add a placeholders
  • How to get all placeholders
  • Cookbook

Was this helpful?

Edit on GitHub
Export as PDF
  1. RocketPlaceholders

API

PreviousMySQL F.A.QNextStarting

Last updated 1 month ago

Was this helpful?

How to use our API

Add the plugin as a dependency:

repositories {
    maven {
        url = uri('https://repo.codemc.org/repository/maven-public/')
    }
}

dependencies {
    compileOnly 'me.Lorenzo0111:RocketPlaceholders:VERSION'
}
<repositories>
    <repository>
        <id>codemc-repo</id>
        <url>https://repo.codemc.org/repository/maven-public/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>me.Lorenzo0111</groupId>
        <artifactId>RocketPlaceholders</artifactId>
        <version>VERSION</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

Replace version with .

Get the API

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

How to add a placeholders

Without permissions nodes

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

With permissions nodes

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

How to get all placeholders

Internal placeholders

this.getAPI().getInternalPlaceholders().getStorageManager().getInternalPlaceholders();

External placeholders

this.getAPI().getInternalPlaceholders().getStorageManager().getExternalPlaceholders().getHashMap();

Placeholders added via API won't synchronized with MySQL

Cookbook

Download and add it as dependency.

Click to view our cookbook.

.

this
here
You can see javadocs here
relase