Skip to content

ez-plugins/teams-api

Repository files navigation

TeamsAPI

CI License Jitpack

TeamsAPI is a universal, timeless bridge plugin for Minecraft servers. Inspired by Vault, it defines a clean, stable interface for team operations so any plugin that needs team data can work with any compatible team plugin — without coupling them together.


How It Works

Your Plugin (consumer)  →  TeamsAPI (bridge)  →  Team Plugin (provider)
  • Providers (e.g. faction, clan, guild plugins) implement TeamsService and register with TeamsAPI during onEnable().
  • Consumers (any plugin that needs team data) call TeamsAPI.getService() and use the returned TeamsService — without knowing which team plugin is installed.
  • Server owners install TeamsAPI.jar alongside any single compatible team plugin.

Download

GitHub Releases | Modrinth | Hangar


For Developers

Add the dependency

Maven (via Jitpack):

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependency>
    <groupId>com.github.ez-plugins</groupId>
    <artifactId>teams-api</artifactId>
    <version>1.1.0</version>
    <scope>provided</scope>
</dependency>

Gradle:

repositories {
    maven { url 'https://jitpack.io' }
}
dependencies {
    compileOnly 'com.github.ez-plugins:teams-api:1.1.0'
}

Consumer usage

// In onEnable() or lazily:
if (!TeamsAPI.isAvailable()) {
    getLogger().warning("No team plugin found — team features disabled.");
    return;
}

// Anywhere team data is needed:
TeamsService teams = TeamsAPI.getService();
Optional<Team> team = teams.getPlayerTeam(player.getUniqueId());
team.ifPresent(t -> player.sendMessage("Team: " + t.getDisplayName()));

Provider registration

private MyTeamsService teamsService;

@Override
public void onEnable() {
    teamsService = new MyTeamsService(this);
    TeamsAPI.registerProvider(this, teamsService);
}

@Override
public void onDisable() {
    TeamsAPI.unregisterProvider(teamsService);
}

Invite service (optional)

If the active team plugin also supports invitations, a TeamsInviteService is available:

if (TeamsAPI.isInviteAvailable()) {
    TeamsInviteService invites = TeamsAPI.getInviteService();
    invites.invitePlayer(teamId, sender.getUniqueId(), target.getUniqueId());
}

Providers that support invitations register the service alongside TeamsService:

@Override
public void onEnable() {
    TeamsAPI.registerProvider(this, teamsService);
    TeamsAPI.registerInviteProvider(this, inviteService);
}

@Override
public void onDisable() {
    TeamsAPI.unregisterProvider(teamsService);
    TeamsAPI.unregisterInviteProvider(inviteService);
}

Events

Provider events extend TeamEvent. Core events are cancellable; invite result events are informational:

@EventHandler
public void onTeamJoin(TeamJoinEvent event) {
    if (event.getTeam().getSize() >= 10) {
        event.setCancelled(true);
    }
}

@EventHandler
public void onInviteAccepted(TeamInviteAcceptEvent event) {
    // player has already joined — informational only
}

For the complete API reference, see docs/api.md.
For integration examples, see docs/developer-guide.md.


Compatibility

  • Java: 21+
  • Server software: Bukkit, Paper, Spigot, Purpur
  • Plugin API baseline: 1.21+

Build from Source

# Compile
mvn -q -DskipTests compile

# Run tests
mvn -q -pl teams-api test

# Build server JAR
mvn -q -DskipTests package

Build requirements: Java 21+, Maven 3.8+.


Project Modules

Module Description
teams-api/ Public API — interfaces, models, and events. Depend on this.
teams-api-plugin/ Bukkit plugin packaging. Server owners install this JAR.

Contributing

  1. mvn -q -DskipTests compile — must succeed.
  2. mvn -q -pl teams-api test — all tests must pass.
  3. mvn -q -pl teams-api checkstyle:check — zero violations.
  4. Add tests for non-trivial logic changes.
  5. Update Javadoc whenever a public API changes.

See AGENTS.md for full coding standards.


License

MIT — see LICENSE.

About

The universal bridge between Minecraft team plugins and everything else.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages