Methods

This is the offical API for PocektMineStudio!

Note

PocketMine Studio is NOT case sensitive

$player

Note

You can use both $player and $p to get the player

Usage: Gets the player who ran an event

Example:

PlayerJoinEvent{
    $player->sendMessage("Welcome!");
    $p->sendMessage("Welcome!");
}

sendMessage

Usage: This method is used to send a player a message

Note

$player = the player you are sending the message to. You can use sm, sendmessage, and message to send messages

Example:

PlayerJoinEvent{
    $player->sendMessage("Welcome!");
    $player->sm("Welcome!");
    $player->message("Welcome!");
}

clearInventory

Usage: This method is used to clear a players inventory

$sender = The player who sends the command

Example:

function CommandEvent{
    command "clear":
            $sender->clearInventory(true);
}

$killer

Note

$killer can only be used in a PlayerDeathEvent function

Usage: Gets the player who killed a player

Example:

PlayerDeathEvent{
    $killer->sendMessage("You killed " . $victim->getName() . "!");
}

$victim

Note

$victim can only be used in a PlayerDeathEvent function

Usage: Gets the player who was killed

Example:

PlayerDeathEvent{
    $victim->sendMessage("$killer->getName() . " killed you!");
}

addStringTag

Note

addStringTag only works for items

Usage: Sets a string tag to an item

Example:

PlayerDeathEvent{
    $victim->sendMessage("$killer->getName() . " killed you!");
}