I know this may be a dumb question.. I don’t get how to do this I’ve tried looking on the forums aswell. Basically what I’m trying to do is have multiple single commands rather than sub-commands. Right now it is /sc spawn & I want to make it /spawn how would I do that? My code is at https://github.com/Trxgically/SpawnsCore/blob/master/src/Trxgically/SpawnsCore/Main.php
PHP: case "spawn": if ($this->config->getNested("set.spawn") === false) { $sender->sendMessage($color5 . "[" . $color2 . "SC" . $color5 . "]" . TF::RESET . " There is no current spawn set!"); } elseif ($this->config->getNested("set.spawn") === true) { $sender->sendMessage($color5 . "[" . $color2 . "SC" . $color5 . "]" . TF::RESET . " Teleporting to spawn..."); $x = $this->config->getNested("sspawn-point.x"); $y = $this->config->getNested("sspawn-point.y"); $z = $this->config->getNested("sspawn-point.z"); $position = new Position($x, $y, $z); $sender->teleport($position); } break; It is at line 116
As said above, I didn’t ask for a plugin. If you would have read the thread you would have seen I am creating a plugin.
Well, you already have written the code to do that actually... PHP: //onCommandswitch ($command->getName()) { case "spawn": //... break;} Either you already found the solution or you're experiencing problems with registering the command.