Permissions Only Output Bukkit Sad

Discussion in 'Plugin Development' started by jkcclemens, Dec 6, 2011.

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

    jkcclemens

    I'll preface this by saying that I'm using PermissionsEx. No, I'm not willing to change it, but I do want to support SuperPerms.

    With that said, whenever I give a if(player.hasPermission("some.perm"), it doesn't really do anything. If it's define in plugin.yml, it doesn't make a difference at all. However, trying to implement a message to be sent if they don't have perms is what I'm really having a problem with. Take this code, for example (it's an example):
    Code:
    if(player.hasPermission("i.like.turtles") {
     player.sendMessage("gratz.");
      return true;
    } else {
      player.sendMessage("You don't have perms!");
      return true;
    }
    return false;
    
    My problem is that everyone sees the Bukkit sad error when they don't have perms.

    What am I doing incorrectly?

    Can you use both the permission: in plugin.yml and with hasPermission?
     
  2. Offline

    Taco

    The permissions node has to be in plugin.yml to be properly registered so that you can check it with hasPermission.
     
Thread Status:
Not open for further replies.

Share This Page