I need help setting player permission via code. Please dont reply with "just use $this" I'm not sure if this is correct or what to do next eh :/ $plugin = Example\Main $perm = “example.command” $bool = true $event->getPlayer()->addAttachment($plugin, $perm, $bool); } Thanks for taking time into reading this post
if you're using PurePerms PHP: /** @var PurePerms $pp *//** @var Player $player */$pp->getUserDataMgr()->setPermission($player, "permission");
PurePerms is spagetti. I do not recommend it for trying to understand the concepts. Sofe made a plugin a while back that simplifies the permission attachment system to something readable. I recommend looking at it to get some understanding. https://github.com/SOF3/simple-plugins/tree/master/SimplePermissions
if you managed to figure this out on your own I'd be very impressed. it's very confusing and misleading. thank bukkit stupidity for that.
Server::getInstance()->dispatchCommand(new ConsoleCommandSender(), "setuperm ".$player->getName()." ".$permission);