Healer Plugin Error

Discussion in 'Plugin Help' started by Seeker, Aug 2, 2019.

  1. Seeker

    Seeker Spider

    Messages:
    6
    GitHub:
    seeker-devs
    So, I recently made a healing plugin with argument. My goal was to make a command which gives the amount of health to a player declared in the argument. Full code:
    PHP:
    <?php
    namespace Seeker\Healer;
    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\Server;
    use 
    pocketmine\event\player\PlayerJoinEvent;
    use 
    pocketmine\Player;
    use 
    pocketmine\event\Listener;
    use 
    pocketmine\command\Command;
    use 
    pocketmine\command\CommandSender;
    class 
    Main extends PluginBase implements Listener{
        public function 
    onLoad(){
            
    $this->getLogger()->info("Healer is Loading");
        }
        public function 
    onEnable(){
     
    $this->getLogger()->info("Healer by Seeker has been Enabled!");
        }
        public function 
    onDisable(){
            
    $this->getLogger()->info("Healer has been Disabled");
        } 
        public function 
    onCommand(CommandSender $senderCommand $cmdstring $label, array $args) : bool{
              if(
    $cmd->getName() == "heal"){
                 if(!
    $sender instanceof Player){
              
    $sender->sendMessage("This Command Only Works for players! Please perform this command IN GAME!");
                 }else{
                   
    $sender->setHealth( + $args[0]);
                   
    $sender->sendMessage("ยง4You have been healed" .count($args[0]). " hearts!");
              }
              return 
    true;
         }
    }
    Console Error:
    [18:35:28] [Server thread/CRITICAL]: ParseError: "syntax error, unexpected end of file, expecting function (T_FUNCTION) or const (T_CONST)" (EXCEPTION) in "plugins/Healer/src/Seeker/Healer/Main" at line 35

    [18:35:28] [Server thread/DEBUG]: #0 (): BaseClassLoader->loadClass(string[18] Seeker\Healer\Main)

    [18:35:28] [Server thread/DEBUG]: #1 (): spl_autoload_call(string[18] Seeker\Healer\Main)

    [18:35:28] [Server thread/DEBUG]: #2 src/pocketmine/plugin/PluginManager(180): class_exists(string[18] Seeker\Healer\Main, boolean 1)

    [18:35:28] [Server thread/DEBUG]: #3 src/pocketmine/plugin/PluginManager(344): pocketmine\plugin\PluginManager->loadPlugin(string[29] /home/gs-40531/plugins/Healer, array[1])

    [18:35:28] [Server thread/DEBUG]: #4 plugins/PocketMine-DevTools (1).phar/src/DevTools/DevTools(71): pocketmine\plugin\PluginManager->loadPlugins(string[23] /home/gs-40531/plugins/, array[1])

    [18:35:28] [Server thread/DEBUG]: #5 src/pocketmine/plugin/PluginBase(123): DevTools\DevTools->onEnable()

    [18:35:28] [Server thread/DEBUG]: #6 src/pocketmine/plugin/PluginManager(588): pocketmine\plugin\PluginBase->setEnabled(boolean 1)

    [18:35:28] [Server thread/DEBUG]: #7 src/pocketmine/Server(2002): pocketmine\plugin\PluginManager->enablePlugin(object DevTools\DevTools)

    [18:35:28] [Server thread/DEBUG]: #8 src/pocketmine/Server(1988): pocketmine\Server->enablePlugin(object DevTools\DevTools)

    [18:35:28] [Server thread/DEBUG]: #9 src/pocketmine/Server(1728): pocketmine\Server->enablePlugins(integer 0)

    [18:35:28] [Server thread/DEBUG]: #10 src/pocketmine/PocketMine(275): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[15] /home/gs-40531/, string[23] /home/gs-40531/plugins/)

    [18:35:28] [Server thread/DEBUG]: #11 src/pocketmine/PocketMine(299): pocketmine\server()

    [18:35:28] [Server thread/DEBUG]: #12 (1): require(string[94] phar:///pro/bin/mcpe/pocketmine-stable-1.12.0/PocketMine-MP.phar/src/pocketmine/)
     
  2. wolfdale

    wolfdale Zombie

    Messages:
    373
    You should probably use an IDE
    Add a } after return true;
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.