Pex Groups in Custom Plugin

Discussion in 'Spigot Plugin Development' started by IJMX, Jun 15, 2016.

  1. I will not waste any time, I would like to get right down to it.

    Basically, I am developing a plugin that displays general information about a player, and I was wondering how to get the group name through pex?
    Example:

    Rank: Owner

    How can I get that to display? As in, what piece of code do I need to use in order for this information to display?

    Any and all help would be appreciated! :)
     
  2. Your best option is probably to use vault
     
  3. You can use this to get all groups that are applicable to a player in a certain world.

    Code (Text):

    PermissionUser user = PermissionsEx.getUser(player);

    String[] groups = user.getParentIdentifiers(world);
     
    Or you can get the players prefix which is set by the group with this method.

    Code (Text):

    PermissionUser user = PermissionsEx.getUser(player);

    String prefix = user.getPrefix(world);