I was looking through the docs and I saw the player.addAttachment function. Does this manually add permissions to the player? If not, is there a way to force a player to be given permissions? Wow, these 502 errors are the worst.....
Well, first you have to detect the plugin in your onEnable method Here, I'm using Permissions Ex as an example (don't forget to import the JAR file!): Code: Plugin pex = this.getServer().getPluginManager().getPlugin("PermissionsEx"); Then all you have to do to check if the player has the permission nodes is: Code: if (player.hasPermission("your node") { //do something }
Thats not what I said. I asked if there was a way to give the player a permission while in-game. (ie plugin-wise)
Yes, there's a way to do that too. If you use the PermissionsEx API, you would use the addPermissions() method. https://github.com/PEXPlugins/PermissionsEx/wiki/Native-API-example#wiki-pex-api-pu-addpermissions
I guess, but this would only work for those with PermissionsEX. Do you know what the player.addAttachment() function does? It says it has something to do with perms, so I'll test it out.
Yes, you can also use the player.addAttachment() function. I just tried it and the syntax goes like this: Code: //Some event or command. { player.addAttachment(plugin, "your node", true); } Where <plugin> is your plugin (this) and <true> is a boolean that determines whether to add the permission to the player or not.