On this page

Events

Two events, both in org.nexo.nxequipement.api.event.

Run code when NxEquipements is ready

@EventHandler
public void onReady(NxEquipementsReadyEvent event) {
    NxEquipementsApi api = event.api();
    getLogger().info("Loaded " + api.sets().size() + " sets");
}

Fires once per server start.

If you only need to grab the API, whenReady is simpler — see Get the API.

Run code when equipment is reloaded

Fires after /nxe reload and after every deploy from the editor.

@EventHandler
public void onReload(NxEquipementsReloadEvent event) {
    getLogger().info("Reloaded " + event.setCount() + " sets");
    for (String setId : event.setIds()) {
        getLogger().info(" - " + setId);
    }
    myCache.clear();
}
If you cache anything from the API, clear it here. After a reload your cached EquipmentSet and EquipmentPiece objects are stale. This event is your signal to rebuild.

Registering the listener

public class MyPlugin extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void onReload(NxEquipementsReloadEvent event) {
        // ...
    }
}

What each event gives you

EventCallReturns
NxEquipementsReadyEventapi()The API
NxEquipementsReloadEventapi()The API
setIds()The ids that were loaded
setCount()How many sets loaded
generation()Goes up by one each reload

Not available in 1.0.0-BETA

There are no equip / unequip / set-completion events yet. To react to gear going on and off, listen to Bukkit's own PlayerArmorChangeEvent and check the item with api.readId(...).

@EventHandler
public void onArmorChange(PlayerArmorChangeEvent event) {
    api.readId(event.getNewItem()).ifPresent(id ->
        event.getPlayer().sendMessage("Equipped " + id.asString()));
}

Last updated August 11, 2026