mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
34 lines
537 B
PHP
34 lines
537 B
PHP
<?php
|
|
|
|
/*
|
|
__PocketMine Plugin__
|
|
name=ExamplePlugin
|
|
version=0.0.1
|
|
author=shoghicp
|
|
class=ExamplePlugin
|
|
*/
|
|
|
|
|
|
class ExamplePlugin implements Plugin{
|
|
private $api;
|
|
public function __construct(ServerAPI $api, $server = false){
|
|
$this->api = $api;
|
|
}
|
|
|
|
public function init(){
|
|
$this->api->console->register("example", "Example command", array($this, "handleCommand"));
|
|
}
|
|
|
|
public function __destruct(){
|
|
|
|
}
|
|
|
|
public function handleCommand($cmd, $arg){
|
|
switch($cmd){
|
|
case "example":
|
|
console("EXAMPLE!!!");
|
|
break;
|
|
}
|
|
}
|
|
|
|
} |