The plugin loads but if I type /hub nothing happens, why? PHP: <?phpnamespace IchHackeNet;use pocketmine\plugin\PluginBase;use pocketmine\command\CommandSender;use pocketmine\command\Command;class Main extends PluginBase{ public function onEnable(){ $this->getLogger()->info("Hub geladen"); $this->getServer()->loadLevel("Lobby"); } public function onCommand(CommandSender $sender, Command $command, string $label, array $args) : bool{ switch($command->getName()){ case "hub": $sender->sendMessage("§eEresia§6MC§7 > §b §7Du wurdest zum §bHub §7teleportiert!"); $sender->teleport($this->getServer()->getLevelByName("Lobby")->getSafeSpawn()); return true; default: return false; } } } Code: name: Hub- main: IchHackeNet\Main version: 0.0.1 api: 3.12.0 load: POSTWORLD author: IchHackeNet description: Hub commands: hub: description: "§eEresia§6MC§7 > §Hub" aliases: ["lobby", "spawn"]
PHP: $this->getServer()->loadLevel("Lobby");$lobby = $this->getServer()->getLevelByName("Lobby");if ($lobby instanceof Level) { $sender->teleport($lobby->getSafeSpawn());}
PHP: <?phpnamespace IchHackeNet;use pocketmine\plugin\PluginBase;use pocketmine\command\CommandSender;use pocketmine\command\Command;class Main extends PluginBase{ public function onEnable(){ $this->getLogger()->info("Hub geladen"); } public function onCommand(CommandSender $sender, Command $command, string $label, array $args) : bool{ switch($command->getName()){ case "hub": $this->getServer()->loadLevel("Lobby");$lobby = $this->getServer()->getLevelByName("Lobby");if ($lobby instanceof Level) { $sender->teleport($lobby->getSafeSpawn());} } } } This don't work