Custom MOTD priorities
Phosphorshy opened this issue ยท 2 comments
Is it possible to add support for both ban and whitelist MOTDs?
like have it check if the player is banned, if they are then display the ban MOTD, if not then move on to the whitelist MOTD checks?
Currently, it only works the other way around as the whitelist motd has a higher priority than the ban motd. But you want the ban motd to appear instead of the whitelist motd if a player is banned, right?
A priority field in the config would be a possibility to implement your request. Like:
ClassicMotd:
Regulars: '&2Welcome back, &e%player%&2! %line%&aIt''s a %weather% %time%.'
Newbies: '&2Welcome newbie! %line%&aIt''s a %weather% %time%.'
RandomMotd:
Enable: false
PRIORITY: 30
Regulars:
- '&bHey %player%! %line%&3Those Motds change totally random!'
Newbies:
- '&bHey Newbie. %line%&3Those Motds change totally random!'
BanMotd:
Enable: false
PRIORITY: 40
MessageTempBan: '&cYou are banned! Reason: &e%reason%%line%&cExpiration: &e%expdate% at %exptime%'
MessageForeverBan: '&cYou are banned! Reason: &e%reason%%line%&cExpiration: &eNEVER'
Format:
Date: 'DD/MM/YYYY'
Time: 'hh:mm:ss'
WhitelistMotd:
Enable: false
PRIORITY: 50
MessageWhitelisted: '&cWelcome back, &e%player%&c!%line%&c&oYou are on the whitelist.'
MessageNotWhitelisted: '&cYou are &lNOT &cwhitelisted.%line%&c&oPlease contact the server owner.'
(Higher priority value motds can overwrite lower priority value motds)
This also introduces more complexity to the configuration I'm not sure everyone "understands" or at least reads the docs. I can already see the issue tickets fly in here after people unknowingly messing with priority value and complaining "the plugin not working at all". (almost like #39, which is probably invalid...)
Do you have a better idea to implement such a priority system in the config?
Could possibly do that yeah
maybe to prevent some tickets you could move priority to it's own section like
# Advanced settings - only edit if you know what you are doing!
# Set these to default values before reporting an issue
Priority:
RandomMotd: 30
BanMotd: 40
WhitelistMotd: 50
or maybe just change the built in priorities to have ban above whitelist because only one config would allow them both to work
(I should note I have no plugin dev experience so I have no idea if anything I'm saying is actually possible)