send player to server on join if player in group

Discussion in 'BungeeCord Plugin Development' started by whycardboard, Aug 11, 2021.

  1. simply put, when a player joins the server, i want to be able to tell if they have a luckperms group or a server permission or something, and move them to another server. really unfamiliar with bungee, and thought this would be a simple problem... any help appreciated, thanks.
     
  2. Code (Text):
    if(player.hasPermission("group." + group)) {
        //do stuff
    }
     
  3. Code (Text):

    @EventHandler
    public void onJoin(PostLoginEvent event) {
        ProxiedPlayer player = event.getPlayer();
        if(player.hasPermission("YourGroupPerms") {
            player.sendMessage();
        }
    }
        }
     
  4. i tried this out, but it seems like the group i've created and joined isn't showing up when running
    Code (Text):
     player.getGroups()
    is there something i'm missing here?
    really appreciate the help so far.
     
  5. Replace "YourGroupPerms" to some perms what have the group
     
  6. Or if you usin LuckPerms you can install LuckPermsAPI into the plugin. Type me more info please :D
     
  7. Bungee can do it
     
    • Funny Funny x 1