Developer API
McHubAPI api = McHubAPI.get(); // null when mcHub is not running
api.servers(); // ids of enabled cards
ServerInfo info = api.server("survival"); // id, known, online, players, max (from the cache)
api.networkPlayers(); // sum of the cards' player counts
api.connect(player, "survival"); // same checks and event as a card click
api.openSelector(player);
api.runAction(player, "server:survival");
api.theme(); // active theme id
api.themes();
api.setTheme("royal"); // saves it too
api.hidingPlayers(player); // also setHidingPlayers, chatShown, setChatShown, flyOn, setFly
api.spawn(); // also setSpawn, teleportToSpawn
api.giveJoinItems(player);
api.isJoinItem(itemStack);
api.portals(); // portal ids
// Your own action type: "shop:armor" in a join item, card or portal calls this.
api.registerAction("shop", (player, argument) -> openShop(player, argument));
api.unregisterAction("shop");
All methods are for the main thread. The status methods read the cache and never wait for the network. Add mcHub to your plugin.yml as softdepend or depend. The API classes are in dev.technotypist.mchub.api.