BoostEndEvent Class Reference

Table of contents

  1. Overview
  2. Package
  3. Class Declaration
  4. Key Methods & Fields
  5. Usage Example
  6. Notes

Overview

BoostEndEvent is fired when a boost is about to end for a player. This event is cancellable, allowing plugins to prevent the boost from ending. It provides full context, including the player and the BoostDefinition.

Package

com.skyblockexp.ezboost.event

Class Declaration

public class BoostEndEvent extends Event implements Cancellable {
    public BoostEndEvent(Player player, String boostKey, BoostDefinition boostDefinition);
    // ...
}

Key Methods & Fields

  • Player getPlayer() – The player whose boost is ending.
  • String getBoostKey() – The unique key of the boost.
  • BoostDefinition getBoostDefinition() – The full boost definition.
  • boolean isCancelled() – Whether the event is cancelled.
  • void setCancelled(boolean cancel) – Cancel or allow the boost end.

Usage Example

@EventHandler
public void onBoostEnd(BoostEndEvent event) {
    if (event.getBoostDefinition().isPermanent()) {
        event.setCancelled(true); // Prevent permanent boosts from ending
    }
}

Notes

  • Fired in all scenarios where a boost may end (expiry, death, region/world change, forced removal, etc.).
  • Always provides the full BoostDefinition for advanced integrations.