Package dev.itsharshxd.zentrix.api
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
GameService- Game management and queriesPlayerService- Player-related operationsTeamService- Team management and queriesClassService- Player class informationCurrencyService- Economy operationsProfileService- Player statisticsPhaseService- Game phase information and dynamic registrationDataService- Data folder and configuration accessRecipeService- Custom recipe managementBroadcastService- Broadcast registration and management (since 1.1.0)GameTypeService- Game type registration and management (since 1.1.0)ItemService- Item registration and management (since 1.1.0)PartyService- Party system operations (since 1.2.0)ChatChannelService- Chat channel management (since 1.2.0)RuntimeWorldService- Runtime-world ownership and shared scopes (since 1.3.0)NetherService- Per-game Nether status and access (since 1.3.0)EndService- Per-game End status and access (since 1.6.0)DeathmatchService- Deathmatch status and startup (since 1.3.0)GameRuleService- Typed dynamic game rules (since 1.3.0)ArenaSourceService- Dynamic source-arena registration (since 1.4.0)MatchmakingService- Atomic group matchmaking (since 1.4.0)LocaleService- Active locale and Zentrix text formatting for addons (since 1.5.0)RevivalService- Teammate elimination and revival control (since 1.6.0)CornucopiaLootService- Cornucopia loot-pool management (since 1.6.0)GameLootService- Per-world lazy game-loot management (since 1.6.0)LootTableCatalogService- Local and Minecraft loot-table discovery (since 1.6.0)CornucopiaService- Cornucopia placement and podium lifecycle (since 1.6.0)BlockMechanicsService- Cornucopia/deathmatch block mechanics (since 1.6.0)CorpseService- Corpse lifecycle and stored loot (since 1.6.0)CompassTrackerService- Teammate compass tracking (since 1.6.0)BuiltInMenuService- Built-in menu opening and extensions (since 1.6.0)GuiLayoutService- GUI layout resolution and registration (since 1.6.0)DragonTransportService- Dragon bus transport and glider deployment (since 1.6.0)ScenarioService- Scenario registration, selection, voting and overrides (since 1.6.0)IdentityService- Packet-level player identity masking (since 1.6.0)EliminationService- Deathless eliminations (since 1.6.0)SkyDropService- Airborne player insertion and glider deployment (since 1.6.0)
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ZentrixAPIget()Returns the ZentrixAPI instance.@NotNull AddonManagerGets the addon manager for addon lifecycle management.@NotNull StringGets the API version for compatibility checks.default @NotNull ArenaSourceServiceDynamic registration of externally installed source arenas.default @NotNull BlockMechanicsServiceOriginal-block protection and placed-block decay in special arenas.@NotNull BroadcastServiceGets the broadcast service for broadcast management.default @NotNull BuiltInMenuServiceBuilt-in menu discovery, opening, and addon extensions.@NotNull ChatChannelServiceGets the chat channel service for chat channel management.@NotNull ClassServiceGets the class service for player class information.default @NotNull CompassTrackerServiceTeammate compass item and target operations.default @NotNull CornucopiaLootServiceCornucopia loot-pool editing, validation, recovery, and eager generation.default @NotNull CornucopiaServiceCornucopia schematic, podium, cage, countdown, and preparation operations.default @NotNull CorpseServiceCorpse spawning, lookup, loot, and removal operations.@NotNull CurrencyServiceGets the currency service for economy operations.@NotNull DataServiceGets the data service for data folder and configuration access.default @NotNull DeathmatchServiceDeathmatch status and start operations.default @NotNull DragonTransportServiceDragon-bus flight, passenger, endpoint, and Matrix Gliders operations.default EliminationServiceEnding a player's or a team's match without a death, through Zentrix's own pipeline.default @NotNull EndServicePer-game End lifecycle and access control.default @NotNull GameLootServiceIndependent main, Nether, End, and deathmatch loot pools.default @NotNull GameRuleServiceTyped dynamic game-rule queries and mutations.@NotNull GameServiceGets the game service for game management operations.@NotNull GameTypeServiceGets the game type service for game type management.default @NotNull GuiLayoutServiceGUI layout discovery, resolution, and runtime registration.default IdentityServicePacket-level player identity masking: aliases, skins, and how Zentrix renders both.@NotNull ItemServiceGets the item service for custom item management.default @NotNull LocaleServiceActive locale and Zentrix text formatting for addons.default @NotNull LootTableCatalogServiceLocal JSON and native Minecraft chest-loot-table catalog.default @NotNull MatchmakingServiceAtomic existing/pending/new-game matchmaking for addons.default @NotNull NetherServicePer-game Nether lifecycle and access control.@NotNull PartyServiceGets the party service for party system operations.@NotNull PhaseServiceGets the phase service for game phase information.@NotNull PlayerServiceGets the player service for player-related queries.@NotNull ProfileServiceGets the profile service for player statistics.@NotNull RecipeServiceGets the recipe service for custom recipe management.default @NotNull RevivalServiceTeammate elimination records, revival overrides, and revival operations.default @NotNull RuntimeWorldServiceRuntime-world lookup across arena, waiting lobby, Nether, and deathmatch.default @NotNull ScenarioServiceScenario registration, configuration, selection, voting, and gameplay overrides.default SkyDropServiceFinding a safe point in the air above a world and dropping a player into it, glider and all.@NotNull TeamServiceGets the team service for team-related operations.static booleanChecks if the ZentrixAPI is available.
-
Method Details
-
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 hasdepend: [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:
trueif the API is initialized and ready to use- Since:
- 1.0.0
-
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
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
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
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
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
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
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
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
Gets the addon manager for addon lifecycle management.Use this to:
- Query registered addons
- Check addon status
- Returns:
- The addon manager instance
-
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
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
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
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
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
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
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
Runtime-world lookup across arena, waiting lobby, Nether, and deathmatch. -
getNetherService
Per-game Nether lifecycle and access control. -
getEndService
Per-game End lifecycle and access control. -
getDeathmatchService
Deathmatch status and start operations. -
getGameRuleService
Typed dynamic game-rule queries and mutations. -
getArenaSourceService
Dynamic registration of externally installed source arenas. -
getMatchmakingService
Atomic existing/pending/new-game matchmaking for addons. -
getLocaleService
Active locale and Zentrix text formatting for addons. -
getRevivalService
Teammate elimination records, revival overrides, and revival operations. -
getCornucopiaLootService
Cornucopia loot-pool editing, validation, recovery, and eager generation. -
getGameLootService
Independent main, Nether, End, and deathmatch loot pools. -
getLootTableCatalogService
Local JSON and native Minecraft chest-loot-table catalog. -
getCornucopiaService
Cornucopia schematic, podium, cage, countdown, and preparation operations. -
getBlockMechanicsService
Original-block protection and placed-block decay in special arenas. -
getCorpseService
Corpse spawning, lookup, loot, and removal operations. -
getCompassTrackerService
Teammate compass item and target operations. -
getBuiltInMenuService
Built-in menu discovery, opening, and addon extensions. -
getGuiLayoutService
GUI layout discovery, resolution, and runtime registration. -
getDragonTransportService
Dragon-bus flight, passenger, endpoint, and Matrix Gliders operations. -
getScenarioService
Scenario registration, configuration, selection, voting, and gameplay overrides. -
getIdentityService
Packet-level player identity masking: aliases, skins, and how Zentrix renders both. -
getEliminationService
Ending a player's or a team's match without a death, through Zentrix's own pipeline. -
getSkyDropService
Finding a safe point in the air above a world and dropping a player into it, glider and all.
-