[TIP] Colored Permissions! (Not the way you are used to)

Discussion in 'Resources' started by ChipDev, Jun 23, 2014.

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

    ChipDev

    Hey guys, today I have a SUPER fast tutorial/tip for you.
    This is on colored permissions,
    First to come to mind is this right?
    Code:java
    1. if(!player.hasPermission(Hi.hi) {
    2. player.sendMessage(ChatColor.RED + "No. no no no!");
    3. }
    4.  

    Nah, This unused way by many is very efficient, also it overrides the reg. permission-message in the config.yml !
    (Also, it overrides other plugins!)

    Put this in onEnable().
    Code:java
    1. getServer().getPluginCommand("yourcommand").setPermissionMessage(ChatColor.BLUE + "Color!");

    And done, easy right?
    -Chip
     
    LordVakar likes this.
  2. Offline

    The Fancy Whale

    player.hasPermission("Hi.hi') btw xD
    Personally not a fan of using the plugin.yml for commands linked to permissions but I guess this is a simple way.
     
  3. Offline

    ChipDev

    Theres another way?
    ^_^
     
  4. Offline

    Onlineids

  5. Offline

    xTigerRebornx

    Onlineids ....or doing the check manually using Player#hasPermission() instead of letting Bukkit handle it (which doesn't require Vault in any way what-so-ever)
     
  6. Offline

    Onlineids

  7. Offline

    xTigerRebornx

    Onlineids What are these "defaults" you speak of?
    Last time I checked, this is a thread about having your command have a specific permission (and colored message when the sender doesn't have that permission). Someone said that they did another way then using the plugin.yml, in which you replied "Vault" (which I assumed meant check the permission with Vault). Vault has no presence here (other then providing an API for economy, chat, and permission plugins use).
     
  8. Offline

    Onlineids

  9. Offline

    Necrodoom

    He is. But you don't seem to be on the same topic as he is.
     
    97WaterPolo and Adriani6 like this.
  10. Offline

    ChipDev

    Onlineids xTigerRebornx
    Im embarrassed, I thought vault was a money plugin ^^

    Im scared... its necrodoom >.<

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

    xTigerRebornx

    ChipDev Is Necrodoom 2spooky4u?
    Necrodoom I agree, he was on a different topic then I was (I don't think this was apparent to him though)
     
    ChipDev likes this.
  12. Offline

    ChipDev

    I don't think it is as wise to check if(player.hasPermission) {.
     
Thread Status:
Not open for further replies.

Share This Page