Hook into OreAnnouncer

OreAnnouncer offers a developer API to handle OreAnnouncer data and information about players and blocks. Whenever something will change in the future it will be deprecated then deleted with future updates, so never use deprecated methods.

You can find some API access examples here!

Importing OreAnnouncer

To add the API to your project you can use use Maven, Gradle or manual adding in classpath.




repositories {
maven {
name = 'alessiodp-repo'
url = 'https://repo.alessiodp.com/releases/'
dependencies {
compileOnly group: 'com.alessiodp.oreannouncer', name: 'oreannouncer-api', version: '2.8.5'


Your plugin must loaded after OreAnnouncer so you have to define this behavior in plugin.yml of your plugin by inserting 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

Then you can take the instance of OreAnnouncer:

OreAnnouncerAPI api = OreAnnouncer.getApi();

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

Event handlers

OreAnnouncer offers some events open to handle, you can hook into them like every Bukkit listener.

public void onPlayerChat(BukkitOreAnnouncerAlertEvent event) {
OABlock block = event.getBlock();

You can read about events here.


You can find the JavaDoc here.