My plugin enabled in my server but it doesn't work, can u guys tell me where is the error? PHP: <?php//7.3.2019 shari7 7Wdevnamespace com\Joker7W;use pocketmine\command\Command;use pocketmine\command\CommandSender;use pocketmine\event\Listener;use pocketmine\event\player\PlayerRespawnEvent;use pocketmine\event\player\PlayerJoinEvent;use pocketmine\Player;use pocketmine\plugin\PluginBase;use pocketmine\Server;use pocketmine\utils\TextFormat;class MainClass extends PluginBase implements Listener { public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this, $this); $this->getLogger()->info(TextFormat::GREEN . "plugin works by 7awari"); } public function onDisable(){ $this->getLogger()->info(TextFormat::DARK_RED . "error"); } public function onJoin(PlayerJoinEvent $e){ $p = $e->getEntity()->getPlayer(); $e->setJoinMessage(""); $p->sendMessage(TextFormat::YELLOW . "Welcome To Our Server!"); $p->sendMessage(TextFormat::LIGHTBLUE . "Plugin By 7awariGamer!"); $p->sendMessage(TextFormat::ORANGE . "Plz Like + Subscribe + Share!"); }}?>
First off, it would be very nice if you could tell us the error instead of just giving us the code. Check out this cool video: Most likely, your error is because "LIGHTBLUE" does not exist. Check https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/utils/TextFormat.php#L45-L60 for the list of TextFormat codes. "LIGHTBLUE" should be replaced with "AQUA"
send the plugin.yml and the file path too! >the onJoin function must be before the onDisable Function this is false; plugin function names can be put in any order
please dont just use "dosent work" dosent work can mean a lot of things, you dont just say "the door dosent work" it might mean: the door is locked, cant be open the door fell off it's hinges the door handle is missing, thus cant be operated the door is jammed, thus blocked from opening see how "dosent work" can mean a lot of things? maybe you should say the PlayerJoinEvent dosent fire/wasnt triggered, also add an echo check maybe also does the "plugin works by 7awari" show on console? event
Yes the plugin isis runni good in the console ! all the functions works good except onjoin function! I mean the mistake is in the function "injoin" and IDK why / what is the error... And sorry for bad English ._. Here is the plugin source code : https://github.com/7Wdev/test3333