API Examples

Player somePlayer;
PartiesAPI api = Parties.getApi();
String partyName = api.getPartyPlayer(somePlayer.getUniqueId()).getPartyName();


PartiesAPI api = Parties.getApi();
Party party = api.getParty("PartyName");
String description = party.getDescription();
if (description.isEmpty()) {
    party.setDescription("new description");
    api.updateParty(party);
}


Player leader; // You need a leader
PartiesAPI api = Parties.getApi();
Status status = api.createParty(api.getPartyPlayer(leader.getUniqueId(), "partyName");
if (status == Status.SUCCESS) {
    // Party created
} else {
    // Something gone wrong
    switch (status) {
      case ALREADYINPARTY:
        // Player already has a party
      case ALREADYEXISTPARTY:
        // Party already exists
    }
}


@EventHandler
public void onPartyCreate(BukkitPartiesPartyPostCreateEvent event) {
    String description = event.getParty().getDescription();
    String prefix = event.getParty().getPrefix();
    // etc..
}


PartiesAPI api = Parties.getApi();
List<Party> list = api.getOnlineParties();