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

error...?

Comments in 'Plugin Development' started by ReventonMC, Apr 20, 2016.

Thread Status:
Not open for further replies.
  1. ReventonMC
    Offline

    ReventonMC New Member

    Joined:
    Sep 9, 2015
    Posts:
    1
    Minecraft User:
    _ReventonMC_
    [Server thread/CRITICAL]: ClassNotFoundException: "Class Tutorial\Main not found" (EXCEPTION) in "/src/spl/BaseClassLoader" at line 131





    ok so this is Main.php
    <?php
    namespace Tutorial;

    use pocketmine\command\Command;
    use pocketmine\command\CommandSender;
    use pocketmine\plugin\PluginBase;

    class MyPlugin extends PluginBase{

    public function onEnable(){
    $this->getLogger()->info("onEnable() has been called!");
    }

    public function onDisable(){
    $this->getLogger()->info("onDisable() has been called!");
    }
    public function onCommand(CommandSender $sender, Command $command, $label, array $args){
    if(strtolower($command->getName()) === "test"){
    $sender->sendMessage("Hello World");
    return true;
    }

    return false;
    }
    }
    ?>





    This is the plugin.yml

    ---
    name: Tutorial
    author: Meee
    description: nothing
    version: 1.0.0
    api: [2.0.0]
    main: Tutorial\Main

    commands:
    tutorial:
    description: It says Hello WOrld.
    permission: tutorial.cmd
    permission:
    tutorial.cmd:
    default: true;
    description: "Send a msg"







    This is how the folder is organized


    [Tutorial]
    \[nbproject]
    ..some files
    \[src]
    \[Tutorial]
    \Main.php
    \plugin.yaml





    Help?... and thx :p
  2. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    Your class name is MyPlugin.

    While you put in plugin.yml:
    Code:
    main: Tutorial\Main
    
    And, PLEASE use PHP tags.
    HotFireyDeath likes this.
Thread Status:
Not open for further replies.

Share This Page

Advertisement