CTMCentral / Parties

πŸŽ‰ A parties plugin for PocketMine-MP servers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Download the plugin on poggit: Poggit
Join my GitHub discord server: Discord

Parties

πŸŽ‰ A parties plugin for PocketMine-MP servers

Available features

  • A complete parties API for developers (with custom events)
  • Usage of forms to manage the parties
  • Customizable party options:
    • Set the maximum party slots
    • Disable the pvp (player versus player) within the members of the party.
    • Teleport the party members to the party leader when the leader gets teleported to a different world.
    • Teleport the party members to the party leader when the leader gets transfered to another server.
    • Make all the party members execute the same command as the party leader.

In-game pictures

Party Menu Your Party Party Member Party Options Invite a player Party Chat

Commands

  • /party β€” Opens the party form
  • /party (message) β€” Sends a message to the party chat

Code examples

Setting the gamemode to spectator to all the members of the party when the party leader invites a player to join their party:

public function onPartyInvite(PartyInviteEvent $event): void {
    $session = $event->getSession();
    if($session->isPartyLeader()) {
        foreach($session->getParty()->getMembers() as $member) {
            $member->getPlayer()->setGamemode(Player::SPECTATOR);
        }
    }
} 

Allow only players with the permission 'slots.limit' to set the maximum slots to more than 3:

public function onUpdateSlots(PartyUpdateSlotsEvent $event): void {
    $session = $event->getSession();
    if(!$session->getPlayer()->hasPermission("slots.limit") and $event->getSlots() > 3) {
        $event->setCancelled();
        $session->message("{RED}You do not have permissions to set the maximum slots to more than 3!");
    }
}

Setting the party public when an operator joins the party:

public function onPartyJoin(PartyJoinEvent $event): void {
    if($event->getSession()->getPlayer()->isOp()) {
        $event->getParty()->setPublic(true);
    }
}

About

πŸŽ‰ A parties plugin for PocketMine-MP servers

License:GNU General Public License v3.0


Languages

Language:PHP 100.0%