How do I create a setPermission attachment?

Discussion in 'Plugin Development' started by Baylorai_, Feb 6, 2021.

Thread Status:
Not open for further replies.
  1. Offline

    Baylorai_

    Hello everyone! I am making a plugin that opens a GUI menu, and you can select 1 class out of 3, When clicking the item block I have set, it will check if the player has a permission and if they don't have the one its checking it well give the boost to the class, as well as give them a permission so they cant click the others.

    I have this all setup but I don't understand how to set a permission to the player, I know the code is
    player.setPermission("example.boost"):
    But I don't know how to create a hashmap to create the permission node I need.

    Any help would be a great help as I've been stuck for awhile and have read over the https://bukkit.gamepedia.com/Develo...oduction.,I will explain first. Via a... More a few times and haven't been able to figure it out

    I attached a photo of my code and what I'm wanting todo, everything on it works, Just now trying to implement adding giving a permission so they can only be assigned to one class.
    If someone could give me an example on how todo this as well that would be awesome as I'm still learning
     

    Attached Files:

  2. Offline

    davidclue

    Permissions are weird I could never get them to work and never found a working method, people just say use another plugins API like vault I believe to handle permissions. You should try and look into other plugins that do similar things or if you really want you could store players that have certain permissions in a UUID list and just cycle through that list to see if they have that class available.
     
Thread Status:
Not open for further replies.

Share This Page