This is a very simple plugin, but I'm sure would help bridge the gap for anyone considering using Xenforo for their website. This plugin is designed to work alongside your existing permissions plugin, and executing commands so that your Xenforo ranks are synced up with your Bukkit/Spigot server ranks.
The plugin is made out of one config file, as so:
mysql: //Insert your xenforo database details
host: localhost
database: xenforo
username: user
password: password
//Change the 'Minecraft' part to whatever custom field ID you set. (case-sensitive)
getGroups: SELECT user_group_id, secondary_group_ids FROM xf_user WHERE user_id = (SELECT user_id FROM xf_user_field_value WHERE field_id = 'Minecraft' AND username= ? LIMIT 1);
//Change these to match your plugin. These commands are for zPermissions. There is setCommand and addCommand to support Xenforo's Primary and Secondary groups. {1}=group {0}=player
clearCommand: permissions player {0} purge //Set this command to clear any data on the player's groups.
setCommand: permissions player {0} setgroup {1} //This command should set a player to one group, and remove all others. For Xenforo's primary groups.
addCommand: permissions group {1} add {0} //This command adds a player to a group. For use with Xenforo's Secondary groups.
//Set the number to the ID of the Xenforo rank, then the name to your permission plugin's rank. The name is what is used in the commands.
groupMappings:
'3': Moderator
'2': Admin
'1': Owner
'4': Member
The above getGroups command is for Xenforo 1.1.x. Use this if you are using Xenforo 1.2.x:
getGroups: SELECT user_group_id, secondary_group_ids FROM xf_user WHERE user_id = (SELECT user_id FROM xf_user_field_value WHERE field_id = 'Minecraft' AND username= ? LIMIT 1);
This plugin will check each player on join, and a Custom Field is used to determine their username. This means that a user can have different website and Minecraft username, and it will still sync up. Note that this method is 1-way, so setting ranks on the server-side will NOT change the Xenforo database.
I hope this is useful to people.
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta