Skip to main content

๐Ÿ“ฆ EventPackService

EventPackService lets developers read EventForge event pack information.

This is useful for:

  • event pack browsers
  • custom GUIs
  • Discord bots
  • dashboards
  • admin panels
  • pack management addons
  • premium event pack tools

Accessing the serviceโ€‹

EventPackService packService = EventForgeAPI.getEventPackService();

Always check the API first:

if (!EventForgeAPI.isAvailable()) {
return;
}

Exampleโ€‹

EventPackService packService = EventForgeAPI.getEventPackService();

for (EventPackInfo pack : packService.getPacks()) {
Bukkit.getLogger().info(pack.getId()
+ " by "
+ pack.getAuthor()
+ " - events: "
+ pack.getEventFileCount());
}

Available methodsโ€‹

Set<String> getPackIds();

Set<EventPackInfo> getPacks();

Optional<EventPackInfo> getPackInfo(String packId);

boolean isPackPresent(String packId);

boolean isPackEnabled(String packId);

int getPackCount();

int getEnabledPackCount();

getPackIds()โ€‹

Gets all discovered event pack IDs.

Set<String> packIds = EventForgeAPI.getEventPackService().getPackIds();

Example:

for (String packId : packIds) {
Bukkit.getLogger().info("Pack: " + packId);
}

getPacks()โ€‹

Gets all discovered event packs.

Set<EventPackInfo> packs = EventForgeAPI.getEventPackService().getPacks();

Example:

for (EventPackInfo pack : packs) {
player.sendMessage(pack.getDisplayName());
}

getPackInfo(String packId)โ€‹

Gets information about a specific pack.

EventForgeAPI.getEventPackService()
.getPackInfo("survival_pack")
.ifPresent(pack -> {
player.sendMessage("Pack: " + pack.getDisplayName());
});

isPackPresent(String packId)โ€‹

Checks whether a pack exists.

boolean present = EventForgeAPI.getEventPackService()
.isPackPresent("survival_pack");

isPackEnabled(String packId)โ€‹

Checks whether a pack exists and is enabled.

boolean enabled = EventForgeAPI.getEventPackService()
.isPackEnabled("survival_pack");

getPackCount()โ€‹

Gets the total number of discovered packs.

int packCount = EventForgeAPI.getEventPackService().getPackCount();

getEnabledPackCount()โ€‹

Gets the number of enabled packs.

int enabledPacks = EventForgeAPI.getEventPackService().getEnabledPackCount();

EventPackInfoโ€‹

EventPackInfo contains public pack information.

String folderName = pack.getFolderName();
String id = pack.getId();
String displayName = pack.getDisplayName();
boolean enabled = pack.isEnabled();
String author = pack.getAuthor();
String version = pack.getVersion();
int eventFileCount = pack.getEventFileCount();

Example: pack browser commandโ€‹

private void sendPacks(CommandSender sender) {
EventPackService packService = EventForgeAPI.getEventPackService();

if (packService.getPacks().isEmpty()) {
sender.sendMessage("No EventForge packs found.");
return;
}

for (EventPackInfo pack : packService.getPacks()) {
sender.sendMessage(pack.getId()
+ " | "
+ pack.getDisplayName()
+ " | enabled="
+ pack.isEnabled()
+ " | events="
+ pack.getEventFileCount());
}
}

Example: checking for required packโ€‹

EventPackService packService = EventForgeAPI.getEventPackService();

if (!packService.isPackEnabled("halloween_pack")) {
getLogger().warning("Halloween pack is not enabled.");
}

Example use casesโ€‹

EventPackService can be used for:

/eventpacks GUI
Discord /eventpacks command
admin dashboards
event pack marketplaces
premium pack loaders
pack validation tools

Summaryโ€‹

EventPackService gives addons safe read-only access to installed EventForge packs.

Use it when your addon needs to display, validate, or organise event pack content.