1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Plugin have problem

Discussion in 'Plugin Help' started by MCForever5, Apr 25, 2020.

  1. MCForever5

    MCForever5 Silverfish

    Messages:
    17
    Hi,can anyone help me?My plugin got problem.But im new at coding.So idk whats wrong i did
    PHP:
    <?php

    namespace CubeTopia\WorldUI

    use pocketmine\Server;
    use 
    pocketmine\Player;

    use 
    pocketmine\plugin\PluginBase;

    use 
    pocketmine\command\Command;
    use 
    pocketmine\command\CommandSender;

    use 
    pocketmine\event\Listener;

    class 
    Main extends PluginBase implements Listener {


        public function 
    onEnable () {
            @
    mkdir($this->getDataFolder());
        
    $this->getServer()->getPluginManage()->registerEvent($this$this);
        }
        
        public function 
    onCommand(CommandSender $senderstring $labwl, array $args) :bool
            
    switch($cmd->getName()){
                case 
    "world"
                    
    if($sender instance of Player){
                        
    $this->openMyForm($sender);
                    }
                break;
            }
            
            return 
    true;
        }
        
        public function 
    openMyWorldForm $player){
        
        
            
    $api $this->getServer()->getPluginManager()->getPlugin("FormAPI");
            
            
    $form $api->createCustomForm(function(Player $player, array $data =null){
                
                if(
    $data === null){
                    return 
    true;
                }
                
                
    $player->sendMessage("Entering World§b " $data[1"§r...")
            });
            
            
    $form->setTitle("§eCube§l§aT§r§eopia");
            
    $form->addLabel("§l§6» §r§7Please Enter the Name of World that you want to join or create");
            
            
    $form->addInput("§l§8»§fWorld Name:""START");
            
            
    $form->sendToPlayer($player);
            
            return 
    $form;
          
        }
        
    }
     
  2. MCForever5

    MCForever5 Silverfish

    Messages:
    17
    Its Its line 5 got problem
     
  3. MCForever5

    MCForever5 Silverfish

    Messages:
    17
    Any please help,thank you! :D
     
  4. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    You forgot a semicolon here (";")
     
  5. MCForever5

    MCForever5 Silverfish

    Messages:
    17
    Thx,theres actually more error.But i fixed all,Thank you.
     
    HimbeersaftLP likes this.
  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.