Skip to main content
The SwissTeams API is somehow extremely simple and extremely complex at the same time. It is designed to be used by SwissMP developers to create plugins that interact with SwissTeams.
BountyTransaction’s will be added soon once the API has been updated to add them.

How do I use it?

Initialize the API:
import dev.jimster.swissteams.api.TeamAPI;
...
public class MyPlugin extends JavaPlugin {

    TeamAPI teamAPI;

    @Override
    public void onEnable() {

        // Initialize the API
        this.teamAPI = SwissTeams.getApi();
        
    }
}
Example, check if player is in a team and get their team name:
import dev.jimster.swissteams.api.TeamAPI;
import org.bukkit.entity.Player;

public class MyListener implements Listener {

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        
        boolean isInTeam = teamAPI.isInTeam(player.getUniqueId());

        if (isInTeam) {
            player.sendMessage("You are in a team!");

            Team team = teamAPI.getTeam(player.getUniqueId());
            player.sendMessage("Your team name is: " + team.getName());

        } else {
            player.sendMessage("You are not in a team.");
        }
    }

}

Api Methods

PropertyTypeDescription
getUsername(UUID)StringGet a players username from the Player Cache
getPlayerCache()HashMap<UUID, String>Return the FULL Player Cache (not recommended)
getUUID(String)UUIDGet a players UUID from their username
getBounties(UUID)List<Bounty>Returns a single bounty. Don’t ask why its a list
hasBounties(UUID)booleanCheck if a player has any bounties
getAllBounties()List<Bounty>Return ALL bounties (not recommended)
getTeam(UUID)TeamGet a players team
isInTeam(UUID)booleanCheck if a player is in a team
getAllTeams()List<Team>Returns ALL team (not recommended)