Skip to content

Latest commit

 

History

History
58 lines (39 loc) · 1.16 KB

README.md

File metadata and controls

58 lines (39 loc) · 1.16 KB

Parties

Parties plugin for PocketMine-MP

Available commands

Commands

Using Parties API

Getting the instance of the plugin

use Parties\Parties;

$instance = Parties::getInstance();

Using events API

use Parties\event\party\PartyCreateEvent;

public function onCreate(PartyCreateEvent $event) {
    $party = $event->getParty();
}

You can see the full event list here

Getting the session of a player

$session = $instance-getSessionManager()->getSession(Player);

Getting the player instance of a session

$player = $session->getOwner();

Getting the party of a player

if($session->hasParty()) {
    $party = $session->getParty();
}

Making all the members of a party do something

foreach($party->getMembers() as $member) {
    $member->function();
}

You can see the full API in the Session and the Party classes.