Change perm with command

Discussion in 'Plugin Development' started by lavatheif, Nov 4, 2016.

Thread Status:
Not open for further replies.
  1. basicaly i have a plugin where the player can double jump, i wanted the command /doublejump to enable/ disable it. how do i do that? i spent ages looking.


    if(cmd.getName().equalsIgnoreCase("doubleJump") && s instanceof Player){
    Player player = (Player) s;
    if(player.hasPermission("Double.Jump")){
    //remove the perm
    }else{
    //give player the perm
    }
    return true;
    }

    how would i give the player the perm?
    also is player.getEffectivePermissions().remove("Double.Jump"); the correct code to remove the perm
     
  2. Offline

    Zombie_Striker

    @lavatheif
    No need. Just create an arraylist to store the player's UUID. When you want to apply the DJ, add them to the list. When you need to check for it, just see if the player's UUID is in the list. If so, make them double jump.
     
  3. Thanks, I never thought of that xD
     
  4. Offline

    Zombie_Striker

    @lavatheif
    If your problem has been solved, mark this thread as solved.
     
Thread Status:
Not open for further replies.

Share This Page