Demeng Development
  • Welcome
  • GrantX
    • GrantX
    • Installation
    • Commands
    • Configuration
    • Developer API
  • Embeddy
    • Embeddy
    • Installation
    • Creating Presets
Powered by GitBook
On this page
  • Setting Up
  • If you have not puchased GrantX
  • If you purchased GrantX
  • Usage
  • Events
  1. GrantX

Developer API

PreviousConfigurationNextEmbeddy

Last updated 2 years ago

Setting Up

If you have not puchased GrantX

Go to and import the latest release (or the release you want) into your IDE or build configuration.

If you purchased GrantX

Simply import the actual plugin (GrantX's JAR) into your IDE or build configuration.

You cannot shade the API or compile it into your own JAR. The API is already provided in the actual plugin.

Usage

Events

There are currently 3 events in the API:

  • - Called after a grant is confirmed.

  • - Called after a grant expires.

  • - Called after a grant revocation is confirmed.

You can use these as you would with vanilla Bukkit events, as such:

public class MyAddonEvent implements Listener {
  @EventHandler
  public void onGrantActivate(GrantActivateEvent e) {
    // Code here
  }
}

As with normal events, you need to register the event in your onEnable method.

Bukkit.getPluginManager().registerListeners(new MyAddonEvent(), this);

Each of these events are called with a object, which contains information about the grant that has been activated, expired, or revoked. Access this object by using #getGrant(). Methods in this class are documented ().

https://github.com/Demeng7215/GrantX-API
dev.demeng.grantx.api.event.GrantActivateEvent
dev.demeng.grantx.api.event.GrantExpireEvent
dev.demeng.grantx.api.event.GrantRevokeEvent
dev.demeng.grantx.api.Grant
click here