Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Plugin

Comments in 'Plugin Development' started by Martin77Epic, Apr 26, 2015.

  1. Martin77Epic
    Offline

    Martin77Epic Banned

    Joined:
    Mar 6, 2015
    Posts:
    164
    Minecraft User:
    CookieMonsterPE
    Hi Guys PLZ give This ----->

    (Code Editor)
    ---------> pocketmine>plugin

    (Name)
    Name:
    OP:
    Default:
  2. Kiosek
    Offline

    Kiosek New Member

    Joined:
    Jun 17, 2014
    Posts:
    34
    Minecraft User:
    Cecil107
    what
    HotFireyDeath likes this.
  3. Martin77Epic
    Offline

    Martin77Epic Banned

    Joined:
    Mar 6, 2015
    Posts:
    164
    Minecraft User:
    CookieMonsterPE
    Code:
    Name:
    childern:
    Default:
    This
    Code:
    <?php
    
    namespace ClearLagg;
    
    use pocketmine\command\Command;
    use pocketmine\command\CommandSender;
    use pocketmine\command\PluginIdentifiableCommand;
    
    class ClearLaggCommand extends Command implements PluginIdentifiableCommand {
    
      public $plugin;
    
      public function __construct(Loader $plugin) {
        parent::__construct("clearlagg", "Clear the lag!", "/clearlagg <check/clear/killmobs/clearall>", ["lagg"]);
        $this->setPermission("clearlagg.command.clearlagg");
        $this->plugin = $plugin;
      }
    
      public function getPlugin() {
        return $this->plugin;
      }
    
      public function execute(CommandSender $sender, $alias, array $args) {
        if(!$this->testPermission($sender)) {
          return false;
        }
        if(isset($args[0])) {
          switch($args[0]) {
            case "clear":
              $sender->sendMessage("Removed " . $this->getPlugin()->removeEntities() . " entities.");
              return true;
            case "check":
            case "count":
              $c = $this->getPlugin()->getEntityCount();
              $sender->sendMessage("There are " . $c[0] . " players, " . $c[1] . " mobs, and " . $c[2] . " entities.");
              return true;
            case "reload":
              // TODO
              return true;
            case "killmobs":
              $sender->sendMessage("Removed " . $this->getPlugin()->removeMobs() . " mobs.");
              return true;
            case "clearall":
              $sender->sendMessage("Removed " . ($d = $this->getPlugin()->removeMobs()) . " mob" . ($d == 1 ? "" : "s") . " and " . ($d = $this->getPlugin()->removeEntities()) . " entit" . ($d == 1 ? "y" : "ies") . ".");
              return true;
            case "area":
              // TODO
              return true;
            case "unloadchunks":
              // TODO
              return true;
            case "chunk":
              // TODO
              return true;
            case "tpchunk":
              // TODO
              return true;
            default:
              return false;
          }
        }
        return false;
          }
    
    }
    And this
  4. TonyDroidd
    Offline

    TonyDroidd Active Member

    Joined:
    Sep 6, 2014
    Posts:
    180
    Minecraft User:
    TonyDroidd
  5. Martin77Epic
    Offline

    Martin77Epic Banned

    Joined:
    Mar 6, 2015
    Posts:
    164
    Minecraft User:
    CookieMonsterPE
    I WILL I HAVE MAKE NOT CLEARLOG I WILL MAKE A PLUGIN FOR ME
  6. TonyDroidd
    Offline

    TonyDroidd Active Member

    Joined:
    Sep 6, 2014
    Posts:
    180
    Minecraft User:
    TonyDroidd
    but that's not your code ...
    HotFireyDeath and RekkuzaRage like this.
  7. PixelGuy75
    Offline

    PixelGuy75 Notable Member Plugin Developer

    Joined:
    Feb 9, 2014
    Posts:
    316
    Plugins:
    2
    Minecraft User:
    PixelGuy75
    HotFireyDeath likes this.
  8. Martin77Epic
    Offline

    Martin77Epic Banned

    Joined:
    Mar 6, 2015
    Posts:
    164
    Minecraft User:
    CookieMonsterPE
  9. Martin77Epic
    Offline

    Martin77Epic Banned

    Joined:
    Mar 6, 2015
    Posts:
    164
    Minecraft User:
    CookieMonsterPE
  10. Martin77Epic
    Offline

    Martin77Epic Banned

    Joined:
    Mar 6, 2015
    Posts:
    164
    Minecraft User:
    CookieMonsterPE
    Will have this
    Code:
    I will make a Plugin
  11. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Before you fix your grammar, nobody will understand what you are saying. Meanwhile, we will ignore you.
    Legoboy0215 likes this.
  12. Martin77Epic
    Offline

    Martin77Epic Banned

    Joined:
    Mar 6, 2015
    Posts:
    164
    Minecraft User:
    CookieMonsterPE

Share This Page

Advertisement