ClanAPI is a virion for PocketMine-MP that provides basic functionality for managing clans
To use the ClanAPI, you can create a new instance of the ClanAPI class:
use Inaayat\Clan\ClanAPI;
// MySQL
$clanAPI = new ClanAPI($ip, $username, $password, $database, $port);
You can then use the methods provided by the ClanAPI class to perform various operations on clans:
$clanAPI->createTable()
: creates the necessary table in the database$clanAPI->addClan($name, $leader)
: adds a new clan to the database$clanAPI->deleteClan($name)
: deletes a clan from the database
$clanAPI->addPlayerToClan($clan, $player)
: adds a player to a clan$clanAPI->removePlayerFromClan($clan, $player)
: removes a player from a clan$clanAPI->getClanByPlayer($player)
: gets the name of the clan that a player belongs to$clanAPI->isLeader($player, $clan)
: checks if a player is the leader of a clan$clanAPI->getAllPlayersInClan($clanName)
: gets an array of all players in a clan$clanAPI->getPlayerCountInClan($clanName)
: gets the number of players in a clan$clanAPI->isInClan($player)
: checks if a player is in a clan
$clanAPI->getClan($name)
: gets information about a clan
$clanAPI->setClanDescription($clan, $description)
: sets the description of a clan$clanAPI->addClanPoints($clan, $points)
: adds points to a clan$clanAPI->removeClanPoints($clan, $points)
: removes points from a clan$clanAPI->setClanPoints($clan, $points)
: sets the points of a clan$clanAPI->isClanOpen($name)
: checks if a clan is open$clanAPI->isClanClosed($name)
: checks if a clan is closed$clanAPI->setClanStatus($name, $status)
: sets the status of a clan$clanAPI->getClanDescription($name)
: gets the clan description$clanAPI->getClanPoints($name)
: gets the clan points