Skip to main content

Getting Started

First step

If you want to use the API make sure to load your plugin after BedWars1058.

  1. Add it as softdepend in plugin.yml: softdepend: [BedWars1058]
  2. Check if BedWars1058 is on the server:
@Override
public void onEnable() {
//Disable if pl not found
if (Bukkit.getPluginManager().getPlugin("BedWars1058") == null) {
getLogger().severe("BedWars1058 was not found. Disabling...");
Bukkit.getPluginManager().disablePlugin(this);
return;
}
}

Getting API Methods

To access the API, you first need to get the BedWars instance.

BedWars bedwarsAPI = Bukkit.getServicesManager().getRegistration(BedWars.class).getProvider();

Common API Methods

  • IArena arena = bedwarsAPI.getArenaUtil().getArenaByPlayer(player): Get the arena a player is currently in.
  • bedwarsAPI.getArenaUtil().getArenas(): Get a list of all arenas.
  • IArena arena = bedwarsAPI.getArenaUtil().getArenaByName("ArenaName"): Get an arena by its name.
  • ITeam team = arena.getTeam(player): Get the team of a player in an arena.

Example: Checking if a player is in an arena

public boolean isInGame(Player player) {
return bedwarsAPI.getArenaUtil().getArenaByPlayer(player) != null;
}

JavaDoc

Click here for JavaDocs.

Configuration

If you want to create a config file for your add-on, you should use our standars and create it in plugins/BedWars1058/Addons/AddonName/config.yml.