Hooking my plugin into groupmanager

Discussion in 'Spigot Plugin Development' started by BBoyJD10, Jun 21, 2015.

  1. Hi so i have my scoreboard plugin and would like it to show what rank you are from group manager but i dont know how to do this. Please help!


    Thank you!
  2. search on "groupmanager api" and then there should be a wiki.ess3.net coming up

    i don't know if this is how to get the group with (vault api)
    public boolean playerInGroup(World world, String player, String group) {
            if (world == null) {
                return playerInGroup((String) null, player, group);
            return playerInGroup(world.getName(), player, group);
    or this
    public String getPrimaryGroup(World world, String player) {
            if (world == null) {
                return getPrimaryGroup((String) null, player);
            return getPrimaryGroup(world.getName(), player);
  3. You should hook into vault
    • Agree Agree x 1
  4. How do i hook into vault and then get the rank?
  5. Were wud i use this ?
  6. Check their github page for the initial setup. From there, you should use the Permission object to get the Player's groups.
  7. Can anyone explain rather then github links?
  8. PHP:
    public String getGroup(final Player base)
            final AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base);
            if (handler == null)
                return null;
            return handler.getGroup(base.getName());
    that should work... then u just do as i said the the conversation ;)
  9. @BBoyJD10 read!

    Here's the method to set-up Vault. If you don't want GitHub, visit their Bukkit Dev page.

    Code (Text):
    public static Permission permission = null;

    private boolean setupPermissions()
            RegisteredServiceProvider<Permission> permissionProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.permission.Permission.class);
            if (permissionProvider != null) {
                permission = permissionProvider.getProvider();
            return (permission != null);
    You can use <Class_Name>.permission#methods() if permissions does not equal null.
  10. That's why I love PEX, they have a great API.
  11. how wud u hook into get rank with PEX?
  12. try search on pex api..