Skip to content

Modules

VIP points and maintenance API

Move VIP points, preview and run purchases, and control network maintenance from your plugin.

VIP points

Java
VippointsService points = api.service(VippointsService.class).orElseThrow(IllegalStateException::new);
points.addAsync(player.getUniqueId(), 100, "MyPlugin:daily-reward").whenComplete((balance, error) -> {
    if (error != null) { /* see below */ return; }
    getLogger().info("New balance: " + balance);
});

Rejections are IllegalArgumentException with a code from VippointsService.REASONS (for example insufficient, limit, user-not-found, purchase-pending, busy). Any other error means the result is uncertain: check the balance before retrying.

purchaseAsync(player, template, expectedPrice) must be preceded by a confirmation shown to the player (previewAsync).

Maintenance

Java
api.service(MaintenanceService.class).ifPresent(m -> {
    if (m.enabled()) getLogger().info("Maintenance: " + m.state().reason);
});

enableAsync(actor, reason, freezeRanks, bonusMillis) and disableAsync(actor, bonusMillis) reject with maintenance-already-on, maintenance-already-off, invalid-duration or busy.