Solved Check if user have permissions

Discussion in 'Spigot Plugin Development' started by Seba4316, Jul 29, 2018.

  1. Hi guys, for checking if the player have a specified permission I use
    Code (Java):
    but I found that someone uses
    Code (Java):
    which is the correct one?

    P.S. Sorry if my english is not perfect I hope you understand what I mean.
  2. p.hasPermission("") is used mostly.
    • Agree Agree x 1

  3. Use

  4. player.hasPermission() returns whether the player has the permission.
    player.isPermissionSet() only returns whether the player is declared to have the permission or not. if player.isPermissionSet(permission) returns true, player.hasPermission(permission) can possibly return false.

    EDIT: read this.
    • Like Like x 1
  5. player#hasPermission("");
  6. Ok, thank you all :D