This is a simple /rules plugin that fetches the rules from a file asynchronously. While I doubt that this will make a noticeable difference in lag on your server, it can't hurt. This plugin is fully configurable. The /rules command will literally display the file exactly as you have defined it. So you are free to set your own formatting however you want. Supports color codes.
Features:
/rules
/rules accept
/rules reload
Logs what version of the rules players accept. If you update the version of the rules in the config.yml, all players will be prompted to accept the new rules.
Whenever a player accepts the rules, you can have the server run a configurable set of commands and messages. So if you want to promote a player on /rules accept, you can easily do so. Players must first read the rules before accepting them.
The best part about the plugin? It doesn't use any stupid aliases for /rules. Just /rules. If you want players to accept the rules, you don't need them to type some weird command, just an intuitive /rules accept.
/rules will display the file exactly as you have it in the rules.txt
The plugin does support multiple pages. Just make sure to tell the players in the rules.txt that there are multiple pages. This is intentional as it allows you to set the formatting however you like.
The only permission this plugin has is for reloading the config. /rule reload: JavaSE.rules.reload
config.yml
Code (YAML):
#"JavaSE.rules.reload" for /rules reload
#Use %player% to get the players name.
acceptCommands
:
- give
%player% diamond 1
acceptBroadcast
: 'This is a &1colored message
%player%'
acceptMessage
: 'This message is sent to you only'
linesPerPage
: 10
#increase this number every time you update the rules. Players with a verion < this number will be prompted to reaccept
rulesVersion
: 1
#this is the message sent to players if they try and accept again
invalidAccept
: '&5You have already accepted the rules. Thank you.'
#this is the message a player receives if they accept the rules prior to reading them
invalidRead
: '&4Please read the rules before accepting them. Type /rules'
#This is the message that a player will get when they join if they have an outdated rules accept.
outdatedRulesMessage
: '&4The rules have been updated! Please read the updated &6/rules&4. Type &6/rules accept&4 to remove this message'
#This is the message that the player will get sent when they accept the rules a second time.
secondAcceptMessage
: '&9Thank you for accepting the updated the rules.'
#These will be run if the player has already accepted the rules once.
acceptTwiceCommands
:
- give
%player% iron_bars 1
acceptTwiceBroadcast
: 'This is a &1colored message
%player%'
#This is what message we will send the player if they have never accepted the rules before.
neverAccepted
: '&8You should read the /rules! When you are done type /rules accept for some rewards!'
#this is the message we send players when they have no perms. This should never be null.
errorNoPerms
: '&4JavaSE has personally forbidden you from using this command.'