Interface ZentrixAPI


public interface ZentrixAPI
Entry point for the Zentrix developer API.

Addons use this API to query and control Zentrix Battle Royale games without depending on the core plugin's implementation.

Usage


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

 // Use a service
 GameService gameService = api.getGameService();
 Collection<ZentrixGame> games = gameService.getActiveGames();
 

Services

Since:
1.0.0
  • Method Details

    • get

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

      Use this method to access the API from anywhere in an addon.

      Example

      
       // Get the API instance
       ZentrixAPI api = ZentrixAPI.get();
      
       // Use services through the API
       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().

      Example

      
       if (ZentrixAPI.isAvailable()) {
           ZentrixAPI api = ZentrixAPI.get();
           // Use the 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
    • getBroadcastService

      @NotNull @NotNull BroadcastService getBroadcastService()
      Gets the broadcast service for broadcast management.

      Use this service to:

      • Register custom broadcasts
      • Query existing broadcasts
      • Control broadcast timing and triggering
      • Filter broadcasts by game state

      Returns:
      The broadcast service instance
      Since:
      1.1.0
    • getGameTypeService

      @NotNull @NotNull GameTypeService getGameTypeService()
      Gets the game type service for game type management.

      Use this service to:

      • Register custom game types (Trios, etc.)
      • Query existing game types
      • Configure game type scoreboards
      • Manage team sizes and player limits

      Returns:
      The game type service instance
      Since:
      1.1.0
    • getItemService

      @NotNull @NotNull ItemService getItemService()
      Gets the item service for custom item management.

      Use this service to:

      • Register custom items
      • Retrieve items by ID
      • Resolve items from multiple sources (vanilla, custom, ItemsAdder, Nexo)
      • Identify items for custom behavior

      Returns:
      The item service instance
      Since:
      1.1.0
    • getPartyService

      @NotNull @NotNull PartyService getPartyService()
      Gets the party service for party system operations.

      Use this service to:

      • Query party state and membership
      • Create, disband, and manage parties
      • Invite, kick, and promote members

      Returns:
      The party service instance
      Since:
      1.2.0
    • getChatChannelService

      @NotNull @NotNull ChatChannelService getChatChannelService()
      Gets the chat channel service for chat channel management.

      Use this service to:

      • Get and set player chat channels
      • Toggle between available channels
      • Check channel availability (team, party)

      Returns:
      The chat channel service instance
      Since:
      1.2.0
    • getRuntimeWorldService

      @NotNull default @NotNull RuntimeWorldService getRuntimeWorldService()
      Runtime-world lookup across arena, waiting lobby, Nether, and deathmatch.
    • getNetherService

      @NotNull default @NotNull NetherService getNetherService()
      Per-game Nether lifecycle and access control.
    • getEndService

      @NotNull default @NotNull EndService getEndService()
      Per-game End lifecycle and access control.
    • getDeathmatchService

      @NotNull default @NotNull DeathmatchService getDeathmatchService()
      Deathmatch status and start operations.
    • getGameRuleService

      @NotNull default @NotNull GameRuleService getGameRuleService()
      Typed dynamic game-rule queries and mutations.
    • getArenaSourceService

      @NotNull default @NotNull ArenaSourceService getArenaSourceService()
      Dynamic registration of externally installed source arenas.
    • getMatchmakingService

      @NotNull default @NotNull MatchmakingService getMatchmakingService()
      Atomic existing/pending/new-game matchmaking for addons.
    • getLocaleService

      @NotNull default @NotNull LocaleService getLocaleService()
      Active locale and Zentrix text formatting for addons.
    • getRevivalService

      @NotNull default @NotNull RevivalService getRevivalService()
      Teammate elimination records, revival overrides, and revival operations.
    • getCornucopiaLootService

      @NotNull default @NotNull CornucopiaLootService getCornucopiaLootService()
      Cornucopia loot-pool editing, validation, recovery, and eager generation.
    • getGameLootService

      @NotNull default @NotNull GameLootService getGameLootService()
      Independent main, Nether, End, and deathmatch loot pools.
    • getLootTableCatalogService

      @NotNull default @NotNull LootTableCatalogService getLootTableCatalogService()
      Local JSON and native Minecraft chest-loot-table catalog.
    • getCornucopiaService

      @NotNull default @NotNull CornucopiaService getCornucopiaService()
      Cornucopia schematic, podium, cage, countdown, and preparation operations.
    • getBlockMechanicsService

      @NotNull default @NotNull BlockMechanicsService getBlockMechanicsService()
      Original-block protection and placed-block decay in special arenas.
    • getCorpseService

      @NotNull default @NotNull CorpseService getCorpseService()
      Corpse spawning, lookup, loot, and removal operations.
    • getCompassTrackerService

      @NotNull default @NotNull CompassTrackerService getCompassTrackerService()
      Teammate compass item and target operations.
    • getBuiltInMenuService

      @NotNull default @NotNull BuiltInMenuService getBuiltInMenuService()
      Built-in menu discovery, opening, and addon extensions.
    • getGuiLayoutService

      @NotNull default @NotNull GuiLayoutService getGuiLayoutService()
      GUI layout discovery, resolution, and runtime registration.
    • getDragonTransportService

      @NotNull default @NotNull DragonTransportService getDragonTransportService()
      Dragon-bus flight, passenger, endpoint, and Matrix Gliders operations.
    • getScenarioService

      @NotNull default @NotNull ScenarioService getScenarioService()
      Scenario registration, configuration, selection, voting, and gameplay overrides.
    • getIdentityService

      @NotNull default IdentityService getIdentityService()
      Packet-level player identity masking: aliases, skins, and how Zentrix renders both.
    • getEliminationService

      @NotNull default EliminationService getEliminationService()
      Ending a player's or a team's match without a death, through Zentrix's own pipeline.
    • getSkyDropService

      @NotNull default SkyDropService getSkyDropService()
      Finding a safe point in the air above a world and dropping a player into it, glider and all.