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

INVISIBLE PLUGIN

Comments in 'Plugin Development' started by GamesLoad, Apr 24, 2015.

  1. GamesLoad
    Offline

    GamesLoad Active Member

    Joined:
    Jun 28, 2014
    Posts:
    106
    Minecraft User:
    GamesLoad
    hello we are creating a very simple plugin that when I write / invis become invisible when the rewrite disable invisibility effect so far I wrote this
    PHP:
    <?php
    namespace invisible;

    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\utils\TextFormat;
    use 
    pocketmine\command\ConsoleCommandSender;
    use 
    pocketmine\event\Listener;
    use 
    pocketmine\command\Command;
    use 
    pocketmine\command\CommandSender;

    class 
    main extends PluginBase implements Listener
    {
    public function 
    onEnable()
    {
        
    $this->getlogger()->info(TextFormat::GREEN .  "Il plugin è partito");
        
    $this->saveDefaultConfig();
    }   
    public function 
    onDisable(){
        
    $this->getLogger()->info(TextFormat::RED "Il plugin è spento");
    }
    public function 
    onCommand(CommandSender $senderCommand $command$label, array $args)
    {
        if (! 
    $sender->isOp ()) {
            
    $sender->sendMessage "Non sei op" );
            return;
        }
        if(
    strtolower($command->$getName())== "invis"){
           
            
    $commandstr_replace("{player}"$player->getName(), $this->getConfig()->get("Comando"));
               
            
    $this->getServer()->dispatchCommand(new ConsoleCommandSender(), $command);
        }
    }
    }
    ?>
  2. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    Um, EssentialsPE already has the invisible feature....
  3. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    Also, please, some grammar and spelling correction?
  4. GamesLoad
    Offline

    GamesLoad Active Member

    Joined:
    Jun 28, 2014
    Posts:
    106
    Minecraft User:
    GamesLoad
    but is not active essentials invisible effect.
    apologize for my English but do not know much
  5. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    EssentialsPE invisible effect works, and is definitely active. It isn't broken. :p
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Don't use dispatchCommand in plugins if it is not necessary. Actually you can just use $player->addEffect().
    GamesLoad likes this.
  7. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    PEMapModder likes this.

Share This Page

Advertisement