Solved Permissions help

Discussion in 'Plugin Development' started by ThatGuyWhoDied13, Dec 10, 2013.

Thread Status:
Not open for further replies.
  1. Hey Guys, Is there a way I can give people permissions? Like if I do the command "/perm <player_name> <permission_name>" it gives the player that permission. I want this so I can add it so when a player gets mod rank on my server I can just type "/perm Kevy_Porter kevy.mod" and they will get the permission.
    Thanks

    Even using an API will be fine (I don't want to use pex though)
     
  2. Offline

    fireblast709

  3. fireblast709 Thanks, I'll look into it

    Help I still can't figure this out... I don't know how to use Vault's API I searched the JavaDocs but still no luck

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  4. Offline

    wizzinangel

  5. wizzinangel *facepalms* How did I forget to look at GitHub :oops:
     
  6. Offline

    wizzinangel

    KevyPorter hehe. You do it once it sticks in your head
     
    KevyPorter likes this.
  7. Offline

    RainoBoy97

    Bukkit.getPlayer("yolo").addAttachment(main instance, "permissions.node", true/false);
    Also works.
     
  8. Offline

    Sleaker

    KevyPorter: This is the correct way to do it, Vault is completely unnecessary.
     
  9. Offline

    Webster56

    The thing is, the name of this method isn't really obvious, i didn't know an attachment was a permission before you mentionned it.

    Quite don't know why they didn't put a setPermission method for the Permissible objects, as there are getters.
     
  10. Offline

    RainoBoy97

    KevyPorter
    To remove a permission, you simply do:
    Code:
    Bukkit.getPlayer("yolo").addAttachment(this, "permissions.node", false);
    
    You set it to false, thus removing the attachment :)
     
    KevyPorter likes this.
  11. Offline

    Webster56

    KevyPorter you can do everything with a setPermission(), depending on the value true or false ;)
     
Thread Status:
Not open for further replies.

Share This Page