ScriptCraft icon indicating copy to clipboard operation
ScriptCraft copied to clipboard

How to detect if user has a group?

Open xfoscarz opened this issue 5 years ago • 1 comments

If the user joining has a staff group, then don't broadcast their join. If they have a paid group, like VIP, or MVP, then broadcast their join. If they are default group, then don't broadcast their join. How would I do that? I'm reading the docs and there doesn't seem to be a way to read the groups that a user has.

xfoscarz avatar Jul 27 '20 15:07 xfoscarz

Some permissions plugins use permissions as a way to detect if a player is on a group or not, like: "groups.example". you could use ".hasPermission()" to detect it.

Edit1: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/permissions/Permissible.html#hasPermission(java.lang.String)

Day-OS avatar Jul 28 '20 15:07 Day-OS