Hello i have recently created commands for staff members on my server but even if the player is not a staff member by my plugin they can show the list of commands on /help that i don't want that they see, so how can i remove of the list if the player don't have a permission or a group on database? My code for creating commands looks like this: Main.php PHP: $this->getServer()->getCommandMap()->register('cmdtest', new cmdtestfile('cmdtest', $this)); cmdtestfile.php PHP: <?phpnamespace server\commands;use pocketmine\command\defaults\VanillaCommand;use pocketmine\command\CommandSender;use pocketmine\Player;class cmdtestfile extends VanillaCommand { public function __construct($name, $plugin) { parent::__construct($name, "cmdtest", "cmdtest <bla bla>"); $this->plugin = $plugin; } public function execute(CommandSender $sender, string $currentAlias, array $args) : bool { }}
I think we can't. But with older PocketMine-MP its working fine. If they don't have permission, they would'nt see a command that they can't execute on help list. Im not sure if it possible to handle '/' when player type it, because its like client's side function right now.
You are not showing us the full code. Try PHP: ... if(!$sender->hasPermission("permission.node")){ $sender->sendMessage("You do not have permission to use this command"); return true; }