Skip to content

PluginBase ​

abstract class · pocketmine\plugin\PluginBase · source

Implements Plugin, CommandExecutor

Methods ​

__construct() ​

php
public function __construct(\pocketmine\plugin\PluginLoader $loader, \pocketmine\Server $server, \pocketmine\plugin\PluginDescription $description, string $dataFolder, string $file, \pocketmine\plugin\ResourceProvider $resourceProvider)

getCommand() ​

php
public function getCommand(string $name)

getConfig() ​

php
public function getConfig() : \pocketmine\utils\Config

getDataFolder() ​

php
final public function getDataFolder() : string

getDescription() ​

php
final public function getDescription() : \pocketmine\plugin\PluginDescription

getFile() protected ​

php
protected function getFile() : string

getFullName() ​

php
final public function getFullName() : string

getLogger() ​

php
public function getLogger() : \AttachableLogger

getName() ​

php
final public function getName() : string

getPluginLoader() ​

php
public function getPluginLoader() : \pocketmine\plugin\PluginLoader

getResource() ​

php
public function getResource(string $filename)

Deprecated

Prefer using standard PHP functions with PluginBase::getResourcePath(), like

Gets an embedded resource on the plugin file. WARNING: You must close the resource given using fclose()

getResourceFolder() ​

php
public function getResourceFolder() : string

Returns the path to the folder where the plugin's embedded resource files are usually located. Note: This is NOT the same as the data folder. The files in this folder should be considered read-only.

getResourcePath() ​

php
public function getResourcePath(string $filename) : string

Returns the full path to a data file in the plugin's resources folder. This path can be used with standard PHP functions like fopen() or file_get_contents().

Note: Any path returned by this function should be considered READ-ONLY.

getResources() ​

php
public function getResources() : array

Returns all the resources packaged with the plugin in the form ["path/in/resources" => SplFileInfo]

getScheduler() ​

php
public function getScheduler() : \pocketmine\scheduler\TaskScheduler

getServer() ​

php
final public function getServer() : \pocketmine\Server

isDisabled() ​

php
final public function isDisabled() : bool

isEnabled() ​

php
final public function isEnabled() : bool

onCommand() ​

php
public function onCommand(\pocketmine\command\CommandSender $sender, \pocketmine\command\Command $command, string $label, array $args) : bool

onDisable() protected ​

php
protected function onDisable() : void

Called when the plugin is disabled Use this to free open things and finish actions

onEnable() protected ​

php
protected function onEnable() : void

Called when the plugin is enabled

onLoad() protected ​

php
protected function onLoad() : void

Called when the plugin is loaded, before calling onEnable()

reloadConfig() ​

php
public function reloadConfig() : void

saveConfig() ​

php
public function saveConfig() : void

saveDefaultConfig() ​

php
public function saveDefaultConfig() : bool

saveResource() ​

php
public function saveResource(string $filename, bool $replace = false) : bool

Saves an embedded resource to its relative location in the data folder

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.