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

Plugin detection issue

Discussion in 'Plugin Help' started by Qazam, Jan 19, 2022.

  1. Qazam

    Qazam Creeper

    Messages:
    3
    Hello everyone,

    My plugin is not detected by the server and I do not receive any error message and when I do the command: plugins it displays that there is no plugin.

    Anyone have a solution please

    Main of my plugin

    <?php

    namespace pluginqazam;

    use pocketmine\command\Command;
    use pocketmine\command\CommandSender;
    use pocketmine\event\player\PlayerJoinEvent;
    use pocketmine\event\player\PlayerQuitEvent;
    use pocketmine\plugin\PluginBase;

    class Main extends PluginBase {
    public function onEnable()
    {
    $this->getLogger()->info("le plugin a bien été activé");
    }


    public function onDisable()
    {
    $this->getLogger()->info("le plugin a bien été désactivé");
    }

    public function onJoin(PlayerJoinEvent $event){
    $player = $event->getPlayer();
    $event->setJoinMessage(joinMessage: " ");

    if(!$player->hasPlayedBefore()) {
    $player->sendMessage("NOUVEAU");
    Server::getInstance()->broadcastMessage(message:"§dBienvenue à §5" . $player->getName() . "§d sur le serveur ! Bon jeu à toi !");
    }else{
    $player->sendMessage("ANCIEN");
    Server::getInstance()->broadcastMessage(message:"§7[§a+§7]§7 " . $player->getName() );
    }
    }

    public function Onquit(PlayerQuitEvent $event){
    $player = $event->getPlayer();

    $event->setQuitMessage( quitMessage: " ");
    Server::getInstance()->broadcastMessage(message :"§7[§c-§7]§7 " . $player->getName());
    }

    public function onCommand(CommandSender $sender, Command $command, string $label, array $args): bool
    {
    switch ($command->getName()){
    case "bvn":
    $name = $sender->getName();
    $sender->sendMessage("§a§oVous avez souhaité la bienvenue.");
    Server::getInstance()->broadcastMessage("§o§b$name §r§a> §bBienvenue Sur Le Serveur Thorium !");
    break;
    }
    return true;
    }
    }

    ---------------------------------------------------------------------------------------------------------------------------------------

    plugin.yml :


    name: PluginTest
    version: 0.1
    api: 3.22.4
    main: pluginqazam\Main
    author: QazamYTB

    commands:
    bvn:
    description: "Permet de dire Bienvenue à un nouveau joueur"
    usage: "/bvn"
    aliases: ['bvn']

    ----------------------------------------------------------------------------------------------------------------------------------------

    Main file path :

    C:\Users\Utilisateur\Desktop\PlQazam\src\pluginqazam


    Thx !
     
  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.