Interface ZentrixAPI


public interface ZentrixAPI
Main entry point for the Zentrix Developer API.

This API allows third-party developers to create addons that interact with Zentrix Battle Royale games without accessing the core plugin source code.

Getting Started


 // Get the API instance (recommended)
 ZentrixAPI api = ZentrixAPI.get();

 // Access services
 GameService gameService = api.getGameService();
 Collection<ZentrixGame> games = gameService.getActiveGames();
 

Available Services

Since:
1.0.0
  • Method Details

    • get

      @NotNull static @NotNull ZentrixAPI get()
      Gets the ZentrixAPI instance.

      This is the recommended way to access the Zentrix API from anywhere in your addon.

      Usage Example

      
       // Get the API instance
       ZentrixAPI api = ZentrixAPI.get();
      
       // Use services
       api.getGameService().getActiveGames();
       api.getCurrencyService().getBalance(player);
       
      Returns:
      The API instance (never null)
      Throws:
      IllegalStateException - if Zentrix is not loaded. Ensure your plugin.yml has depend: [Zentrix] to guarantee load order.
      Since:
      1.0.0
    • isAvailable

      static boolean isAvailable()
      Checks if the ZentrixAPI is available.

      Use this method to safely check whether the API can be accessed before calling get().

      Usage Example

      
       if (ZentrixAPI.isAvailable()) {
           ZentrixAPI api = ZentrixAPI.get();
           // Safe to use API
       }
       
      Returns:
      true if the API is initialized and ready to use
      Since:
      1.0.0
    • getAPIVersion

      @NotNull @NotNull String getAPIVersion()
      Gets the API version for compatibility checks.

      Addons should check this version to ensure compatibility with the installed Zentrix version.

      Returns:
      Semantic version string (e.g., "1.0.0")
    • getGameService

      @NotNull @NotNull GameService getGameService()
      Gets the game service for game management operations.

      Use this service to:

      • Get active games
      • Find which game a player is in
      • Query game state and information

      Returns:
      The game service instance
    • getPlayerService

      @NotNull @NotNull PlayerService getPlayerService()
      Gets the player service for player-related queries.

      Use this service to:

      • Get player information within games
      • Check player states (alive, spectating)
      • Query player game statistics

      Returns:
      The player service instance
    • getTeamService

      @NotNull @NotNull TeamService getTeamService()
      Gets the team service for team-related operations.

      Use this service to:

      • Get team information
      • Check team membership
      • Query team status (alive, eliminated)

      Returns:
      The team service instance
    • getClassService

      @NotNull @NotNull ClassService getClassService()
      Gets the class service for player class information.

      Use this service to:

      • Get available player classes
      • Query class details and abilities
      • Check player's selected class

      Returns:
      The class service instance
    • getCurrencyService

      @NotNull @NotNull CurrencyService getCurrencyService()
      Gets the currency service for economy operations.

      Use this service to:

      • Check player balances
      • Get currency configuration
      • Query reward amounts

      Returns:
      The currency service instance
    • getProfileService

      @NotNull @NotNull ProfileService getProfileService()
      Gets the profile service for player statistics.

      Use this service to:

      • Get player lifetime statistics
      • Query wins, kills, deaths, etc.
      • Access player rankings

      Returns:
      The profile service instance
    • getPhaseService

      @NotNull @NotNull PhaseService getPhaseService()
      Gets the phase service for game phase information.

      Use this service to:

      • Get current phase for a game
      • Query phase configurations
      • Check phase timings and borders

      Returns:
      The phase service instance
    • getAddonManager

      @NotNull @NotNull AddonManager getAddonManager()
      Gets the addon manager for addon lifecycle management.

      Use this to:

      • Query registered addons
      • Check addon status

      Returns:
      The addon manager instance
    • getDataService

      @NotNull @NotNull DataService getDataService()
      Gets the data service for data folder and configuration access.

      Use this service to:

      • Access the Zentrix plugin data folder
      • Create addon-specific data folders
      • Read and write configuration files
      • Access Zentrix configuration values (read-only)

      Returns:
      The data service instance
    • getRecipeService

      @NotNull @NotNull RecipeService getRecipeService()
      Gets the recipe service for custom recipe management.

      Use this service to:

      • Register custom crafting recipes
      • Query existing recipes
      • Check player craft limits
      • Manage recipe restrictions (one-time, craft limits)

      Returns:
      The recipe service instance