Skip to content
Leonhard edited this page Aug 20, 2021 · 4 revisions

PunishControl features an API that helps you to interact with all parts of the plugin.

Adding

To use the PunishControl API you will need to have PunishControl installed. It will only be available after the plugin is enabled.

<repository>
 <id>simplix</id>
 <url>https://repo.simplix.dev/repository/simplixsoft-public/</url>
</repository>
<dependency>
  <groupId>dev.simplix.plugins</groupId>
  <artifactId>punishcontrol-api</artifactId>
  <version>2.0.1</version>
  <scope>provided</scope>
</dependency>

Now you can obtain a PunishControlAPI instance

import dev.simplix.plugins.punishcontrol.PunishControlAPI;

public void obtainInstance(){
  // This will throw an IllegalStateException if PunishControl is not yet initialized
  PunishControlAPI.instance();
}

List punishments

 PunishControlAPI#listPunishments 

Remove punishment

 PunishControlAPI#removePunishment 

Create punishment

  PunishControlAPI#createPunishment

Add Listener

Static method:

PunishControlAPI#registerListener

Clone this wiki locally