-
Notifications
You must be signed in to change notification settings - Fork 2
API
- You need a softdepend or depend to MTTT in your plugin.yml
depend: [MTTT]
softdepend: [MTTT] - Get your TTTApi Instance
TTTApi api;
public void onEnable(){
...
if (Bukkit.getPluginManager().isLoaded("MTTT")){
api = TTTApi.getInstance();
}
else{
//MTTT not loaded/installed
}
}getArena(String name) returns Arena - Returns Arena object with given name, null if arena is non existing.
getArena(Player player) returns Arena - Returns Arena object where the player is in, null if player is not ingame.
getPlayer(Player player) returns TTTPlayer - Returns TTTPlayer object of Player player.
isPlaying() returns boolean - Returns true if player is playing.
getRole() returns String - Returns the role of the player in the current arena.
getColoredRole() returns String - Returns the colored role of the player in the current arena.
leave(boolean silent) returns nothing - Leaves the player from the current arena.
join(Arena a) returns nothing - Tries to join the player to the given arena.
getPlayer() returns Player - Returns the spigot Player object.
Triggered when a player gets killed by another player ingame.
@EventHandler
public void onRoleKillRoleEvent (RoleKillRoleEvent e){
...
}
//Event functions
public Arena getArena() {
}
public Player getKiller() {
}
public Player getPlayer() {
}
public String getPlayerRole() {
}
public String getKillerRole() {
}Triggered when a arena changes its gamestate (waiting , ingame , end) Also triggered when a arena restarts in infinite mode (from: end , to: waiting)
@EventHandler
public void onArenaStateChangeEvent (ArenaStateChangeEvent e){
...
}
//Event functions
public Arena getArena() {
}
public String getFrom() {
}
public String getTo() {
}