Skip to content

Instantly share code, notes, and snippets.

@Ad5001
Last active December 30, 2015 19:34
Show Gist options
  • Save Ad5001/2e6f65b36a3caab5879b to your computer and use it in GitHub Desktop.
Save Ad5001/2e6f65b36a3caab5879b to your computer and use it in GitHub Desktop.
Test - Auto-generated gist plugin stub by pmt.mcpe.me InstaPlugin
---
name: Test
author: Ad5001
version: "0.01"
api: 1.13.0
main: Ad5001\Test\Main
website: http://ad5001.tk
description: A simple test plugin to trying to create a pocketmine plugin
commands:
test:
description: "This is a test command that display in the chat what is sayed"
usage: "/test <text>"
permission: test.command.text
permissions:
test.command.test:
default: op
description: "Broadcast a message in the chat"
...
<?php
namespace Ad5001\Test;
use pocketmine\command\CommandSender;
use pocketmine\command\Command;
use pocketmine\event\Listener;
use pocketmine\plugin\PluginBase;
class Main extends PluginBase{
public function onEnable(){
$this->saveDefaultConfig();
$this->getLogger()->info("Test is enable this is for my own use there is nothing really interesting here!");
// $this->getServer()->getPluginManager()->registerEvents($this, $this);
}
public function onCommand(CommandSender $issuer, Command $cmd, $label, array $params){
switch($cmd->getName()) == "test"){
$message = "This is a test"
$sender->getServer()->broadcastMessage($message);
return true;
}
return false;
}
public function onDisable(){
$this->getLogger()->info("Test plugin has been disable!");
}
public function onLoad(){
$this->getLogger()->info("Test plugin has been loaded!")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment