Skip to content

Latest commit

 

History

History
64 lines (50 loc) · 2.4 KB

README.md

File metadata and controls

64 lines (50 loc) · 2.4 KB

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);
    }
}