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

Solved ClassPath error

Comments in 'Plugin Development' started by zombie_Power, Oct 24, 2015.

  1. zombie_Power
    Offline

    zombie_Power Active Member

    Joined:
    Sep 7, 2015
    Posts:
    239
    Minecraft User:
    Zombie_Power
    Greetings,

    I am trying to create a plugin (private), but keep getting this error on pmt.mcpe.me
    Code:
    Classpath•Inspection result: Error
    •Errors◦Main class file expected at src/Help/Main.php but it is not a file
    
    
    my classpath
    PHP:
    namespace Help;

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

    class 
    Main extends PluginBase implements Listener {
    My plugin.yml
    PHP:
     nameHelp
    main
    Help\Main
    version
    1.0.0
    api
    : [1.2.0]
    authorZombie
    description
    helps the player
    commands
    :
        
    ilife:
            
    descriptionalternative to /help
            usage
    : /ilife
         
         
    Any assistance appreciated :)
  2. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    is file name Main.php ?
    zombie_Power likes this.
  3. zombie_Power
    Offline

    zombie_Power Active Member

    Joined:
    Sep 7, 2015
    Posts:
    239
    Minecraft User:
    Zombie_Power
    yes
  4. k3ithkfng
    Offline

    k3ithkfng Active Member

    Joined:
    Jul 9, 2015
    Posts:
    91
    Minecraft User:
    K3ith
    Um... I think you forgot to put <?php opening tag in the main.php code...
    Also, why is there a space in the plugin.yml file in the "name" row?
    zombie_Power likes this.
  5. zombie_Power
    Offline

    zombie_Power Active Member

    Joined:
    Sep 7, 2015
    Posts:
    239
    Minecraft User:
    Zombie_Power
    I didn't forget the <?php :p and the space occurred due to copying it directly from my IDE
  6. zombie_Power
    Offline

    zombie_Power Active Member

    Joined:
    Sep 7, 2015
    Posts:
    239
    Minecraft User:
    Zombie_Power
    Btw I used the plugin in my FTP, and it showed the same error :(
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Do you have a file there?
    zombie_Power likes this.
  8. zombie_Power
    Offline

    zombie_Power Active Member

    Joined:
    Sep 7, 2015
    Posts:
    239
    Minecraft User:
    Zombie_Power
    what do you mean?
    Last edited: Oct 24, 2015
  9. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Do you have a file called src/Help/Main.php? According to your plugin.yml, it should be the main class.
    zombie_Power likes this.
  10. zombie_Power
    Offline

    zombie_Power Active Member

    Joined:
    Sep 7, 2015
    Posts:
    239
    Minecraft User:
    Zombie_Power
    yes :( my netbeans IDE automatically makes them- src(folder:it has the plugin.yml)-> Help(folder: which has the Main.php)
    Last edited: Oct 25, 2015
  11. zombie_Power
    Offline

    zombie_Power Active Member

    Joined:
    Sep 7, 2015
    Posts:
    239
    Minecraft User:
    Zombie_Power
    Thanks for you help guys! I have solved the problem.

Share This Page

Advertisement