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

My pmmp4 first plugin (so bad)

Discussion in 'Requests' started by Miguu, Jul 20, 2022.

  1. Miguu

    Miguu Creeper

    Messages:
    1
    Hi, i just started learning pmmp4 yesterday, and i just finished my first plugin today, i uploaded it on my server and the console says "not found Main class", idk where i miss and i would like you say it to me, i know a bit cuz i dont understand English so good and there are so few tutorials in spanish that are not for 14 years old kids, plz help me.
    namespace Miguu\Prueba;

    use pocketmine\plugin\PluginBase;
    use pocketmine\command\Command;
    use pocketmine\command\CommandSender;
    use pocketmine\event\Listener;
    use pocketmine\Player;

    class Main extends PluginBase {

    protected function onEnable() : void{
    $this->getLogger()->info("Plugin has been Enabled");
    $this->getServer()->getPluginManager()->registerEvents(new EventListener(), $this);
    }
    public function onCommand(CommandSender $sender, Command $cmd, string $label, array $args) : bool{
    switch($cmd->getName()){
    case "lore":
    $name = $sender->getName();
    if($sender->hasPermission(prueba.command.lore)){
    if(!$sender instanceof Player){
    $sender->sendMessage("Gilipollas, esto solo funciona en el juego");
    }
    $sender->sendMessage("Lore," . $name . "te ama");
    }
    return false;
    }
    }
    }
    ?>
     

    Attached Files:

  2. GamingFR91

    GamingFR91 Spider Jockey

    Messages:
    29
    GitHub:
    kanekilechomeur
    Check the File name or check the plugin.yml if there is not a problem with folder name
     
  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.