Hook into OreAnnouncer

OreAnnouncer offers some API to work with.

Importing OreAnnouncer





repositories {
    maven {
        name = 'alessiodp-repo'
        url = 'https://repo.alessiodp.com/releases/'

dependencies {
    compileOnly group: 'com.alessiodp.oreannouncer', name: 'oreannouncer-api', version: '2.7.2'

Implementing OreAnnouncer

Open plugin.yml and insert OreAnnouncer as depend (or soft-depend):

depend: [OreAnnouncer]
soft-depend: [OreAnnouncer]

Before hook into it, be sure its enabled!

if (getServer().getPluginManager().getPlugin("OreAnnouncer") != null) {
    if (getServer().getPluginManager().getPlugin("OreAnnouncer").isEnabled()) {
        // OreAnnouncer is enabled

API Methods

OreAnnouncer offers a class called OreAnnouncerAPI, you can declare it to call API methods. This is how you can use it:

OreAnnouncerAPI api = OreAnnouncer.getApi();
OAPlayer player = api.getOAPlayer(simplePlayer.getUniqueId()); // Get the player
if (player.haveAlertsOn()) {
  // Alerts enabled
} else {
  // Alers disabled


You can find the JavaDoc here.