Hey again, I just finished a new plugin and i wanted to test it but the server just crashed. I get this error: Error: Declaration of ForeverCMD\main:nCommand(pocketmine\command\Command $cmd, pocketmine\command\CommandSender $sender, array $args, string $label): bool must be compatible with pocketmine\plugin\PluginBase:nCommand(pocketmine\command\CommandSender $sender, pocketmine\command\Command $command, string $label, array $args): bool I just don't know what it means because I think mine and the "Compatible" are the same.
I solved it, strangely you had to put the uses in the right order... Now i have another error that says: pocketmine\plugin\PluginManager::registerEvent(): Argument #1 ($event) must be of type string, ForeverCMD\main given, called in C:\Users\arese\Desktop\PocketMine-MP-stable\plugins\forevercmd\src\forevercmd\main.php on line 24 Does anyone know what i'm doing wrong? I didn't code since PM3.20
Heres the Code by the way Code: public function onEnable(): void { $this->getLogger()->info("ForeverCMD is activated!"); $this->getServer()->getPluginManager()->registerEvent($this, $this); @mkdir($this->getDataFolder()); $this->saveDefaultConfig(); $this->getResource("config.yml"); }
public function onCommand(CommandSender $sender, Command $command, string $label, array $args): bool { //your cmd return true; }