How do I check if someone is op?

Discussion in 'Plugin Development' started by Vetlix, Jun 14, 2019.

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

    Vetlix

    Hey, I want to check if someone is op or has the permission plugin.permission so basically if they are op they can run the command and if not.
    Heres my code:
    if(p.hasPermission(("plugin.permission")))
     
  2. Offline

    timtower Ninja on the waves Moderator

  3. Offline

    Tommy_T0mmY

    if (p.hasPermission("plugin.permission") || p.isOp()) { ... }

    But i think you only need if(p.hasPermission("plugin.permission") { ... } because if a player is Op he also got the "plugin.permission" permission.
     
  4. Offline

    timtower Ninja on the waves Moderator

    That highly depends on your plugin.yml
     
Thread Status:
Not open for further replies.

Share This Page