my try: PHP: public function onCommand(CommandSender $sender, Command $command, string $label, array $args): bool{ if($command->getName() == "ok"){ if(count($args) > 1){ $player = $this->getServer()->getPlayer($args[0]); $perm = $args[1]; $this->addAttachment($player, $perm, true); }else{ $sender->sendMessage("/ok name perm"); } } return true; }
PHP: /** @var Permission $permission **/$attachment $player->addAttachment($pluginBase, $permission, true);// or$attachment = $ev->getplayer()->addAttachment($pluginBase);$attachment->setPermission($permission, true); just make sure you save the attachment for later use