Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <?php
  2.  
  3. namespace myplugin;
  4.  
  5. use pocketmine\command\Command;
  6. use pocketmine\permission\Permission;
  7. use pocketmine\plugin\PluginBase;
  8. use pocketmine\event\Listener;
  9. use pocketmine\utils\TextFormat;
  10. use pocketmine\utils\Config; /* NOT IN USE (YET) */
  11. use pocketmine\command\CommandExecutor;
  12. use pocketmine\command\CommandSender;
  13.  
  14. class Loader extends PluginBase implements Listener{
  15.  
  16. public function onEnable(){
  17. $this->getServer()->getPluginManager()->registerEvents($this, $this);
  18. }
  19.  
  20. public function onCommand(CommandSender $sender, Command $command, $label, array $args) {
  21.  
  22. switch($command->getName()){
  23. case "beta":
  24. $sender->getName();
  25. if($sender->hasPermission("myplugin.beta")){
  26. $sender->getInventory()->addItem(Item::get(313,0,1));
  27. $sender->sendMessage(TextFormat::BLUE . "Command Given:Complete");
  28.  
  29. return true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement