|
Post by SarcasticSarah on Jan 7, 2018 13:29:37 GMT
I'm probably making a custom plugin for my server but I need help with adding permissions to my code this is all I have done with my main class | | | V Plot Twist : I have put the if(s.hasPermission("rabbitrpg.getassassinskit")); in my Command_assassinskit class but it's still not working
|
|
Mafrans
Veteran Member
We assholes need to stick together, if you're a fellow asshole please pm me.
Posts: 1,760
| Likes: 1,703
|
Post by Mafrans on Jan 7, 2018 13:57:53 GMT
You need to add a "permissions" property to your plugin.yml. For example, this is how a plugin.yml could look: name: MyPlugin version: 1.0 author: Mafrans main: me.mafrans.myplugin.MyPlugin
commands: mycommand: description: A sample command, requires permission myplugin.mycommand usage: /<command> permission: myplugin.mycommand #Note: "permission" property not required if using "player.hasPermission("<permission>")"
permissions: myplugin.*: description: Parent permission containing all other myplugin permissions. default: false #Defines the child permissions of this permission, used similarily to "default" but with multiple permissions. children: myplugin.mycommand: true
myplugin.mycommand: description: Allows usage of the command "/mycommand" #Default can be either "op" (OPs can use the command by default), "true" (Everyone can use the command by default), or "false" (Noone can use the command by default) default: op
Omnivion made a great guide for this over at www.spigotmc.org/threads/guide-advanced-plugin-yml.64421/
|
|