Hi, I'm having a small mistake in a plugin. I'm trying to set a custom executor, but it doesn't work... My main class OnEnable: PHP: public function OnEnable() { $this->getServer()->getPluginManager()->registerEvents(new EvListener($this),$this); @mkdir($this->getDataFolder()); @mkdir($this->getDataFolder() . "players/"); $command = new PluginCommand("mc",$this); $command->setExecutor(new Mc($this)); $this->getServer()->getCommandMap()->register("mc",$command); $this->saveResource("settings.yml"); $this->saveResource("groups.yml"); $this->getLogger()->info(TextFormat::GREEN . "MagicChat " . MagicChat::VERSION . " by @AndrewBit4 enabled."); if($this->getConf("Broadcaster")[0]){ $this->getServer()->getScheduler()->scheduleRepeatingTask(new Broadcaster($this),$this->getConf("Broadcaster")[1] * 20); } if($this->getConf("Popup")[0]){ $this->getServer()->getScheduler()->scheduleRepeatingTask(new PopupTask($this),$this->getConf("Popup")[1] * 20); } } My command executor: PHP: <?phpnamespace andrew\Commands;use pocketmine\command\Command;use pocketmine\command\CommandExecutor;use pocketmine\command\CommandSender;use pocketmine\Player;use andrew\MagicChat;class Mc implements CommandExecutor { private $plugin; public function __construct(MagicChat $plugin){ $this->plugin = $plugin; } public function onCommand(CommandSender $sender, Command $cmd, $label, array $args) { $fcmd = $cmd->getName(); if(strtolower($fcmd) === "mc"){ $sender->sendMessage("Mc works!"); } }}?> Plugin yaml: PHP: name: MagicChatmain: andrew\MagicChatversion: "0.1"api: [1.12.0]author: AndrewBit4description: Manage your chat like never before!website: http://twitter.com/AndrewBit4commands:mc: aliases: [magicchat] description: Magic chat commands. default: op
Is there any errors on load? Any errors at all? More info would be better crashes in the background when you execute the command
Oh wait. You are registering twice. either register it in plugin.yml then use $this->getCommand() to get the instance, or just delete the registering in plugin.yml and setup the data in code entirely.