Default permissions

Discussion in 'Spigot Plugin Development' started by ZevoGaems, Apr 14, 2017.

  1. I am making a ban plugin and I want to make it so if a player has the permission they get kicked on join. 1 problem is I don't know how to set default permissions so it automatically becomes all ops and when a op tries to join they get kicked over and over again. Please help.
     
  2. FrostedSnowman

    Resource Staff

    Code (Java):
    if (!player.isOp && player.hasPermission()) {
    }
     
    not sure if this would work.
     
  3. I guess I could make ops exempt from bans
     
  4. yeah, it should work.
    Player#isOp() returns a Boolean value
     
  5. NathanWolf

    Supporter

    Add the permission to your plugin.yml with default: false, then ops won't have it.

    Note that if it's for a public plugin you'll probably still have issues with silly admins who think it's cool to grant themselves "*".
     
    • Like Like x 1