Skip to content
James McNair edited this page Jun 30, 2020 · 9 revisions

API

NOTE: This API is experimental, the code within it will not change, but there may be some problems when viewing javadocs etc. as full verification has not been carried out yet.

Adding the dependency

In your plugin.yml add: softDepend: [BetterTeams]

Or if your plugin is reliant on betterTeams to work as expected: depend: [BetterTeams]

Javadocs

To view the javadocs, view this github html viewer. This will allow you to view all methods and javadocs for the whole program. The areas of the highest importance to view are Team.java, this class is the class which handles all management for an individual team.

Basic Methods

As teams are the fundamental system which this plugin is based off. Most of the time the first thing you will need to do is get the Team that you need, this can be done using several values:

  • With a player who is in a team: Team.getTeam(Player player) This static method will return the team that the player is in, or null if they are not in a team.
  • With a team name: Team.getTeam(String teamName) This static method will return the team that has that name. like Minecraft player names, this should only be used when allowing a player to run a command, this is because team names can be changed.
  • With the team UUID: Team.getTeam(UUID teamUUID) This is the recommended method when storing a reference to a team, this is because it will remain constant for the entire existence of a team.
    Once you have a team view the Team class to see what methods are available.

TeamPlayers: are players which are in a team, In short this class is used as a wrapper to store all information about a player relating to their status with their current team (ie rank). these should only be used to get values and change their ranks, read the javadocs carefully as some methods should not be used.

Events

Currently, there is a basic event system with a single event. With this, when any change is made to below a players name this is used: BelowNameChangeEvent. It is not recommended to currently use the plugin event system as there are plans to change this for the next BetterTeams update.

Clone this wiki locally