Disable or Enable chat and command access for specific time periods for specific players.
Download on SpigotMC: https://www.spigotmc.org/resources/chatrestrict.102607/
Rules are used to determine the condition in which a player may or may not be able to talk or send a command.
Simply add new rule types to the rules.yml
to add them.
- If the rule returns true, they are able to talk.
- If the rule returns false, they are unable to talk.
- The opposite occurs for "flip" and "disallowed_command" type rules.
Each rule is given a name, type, and the parameters relating to that type.
For example, this creates a rule named weekend-check
which allows chat on Saturday and Sunday.
rules:
weekend-check:
type: "allowed_weekdays"
week_days: ["SATURDAY", "SUNDAY"]
This is the default rules.yml file which includes a ruleset (with two contained rules) and two other separate rules. With these default values, chat is allowed on every day of the week except between 11:59 PM and 12:00 AM. Three fake commands are also blocked, regardless of if the ruleset is true. The time between 4:32 AM and 4:33 AM has chat blocked, also regardless of whether other rules are true.
For example, if the server admin wanted they could add a "disallowed_commands" rule type to a ruleset, along with rules for specific times and days of the week, to restrict those commands on a specific schedule (unless the player has a bypass permission).
rules:
chat-allowed:
type: "ruleset"
rules:
chat-days:
type: "allowed_weekdays"
week_days: ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"]
chat-time:
type: "allowed_timerange"
time_min: "0:00 AM"
time_max: "11:59 PM"
zone: "America/Chicago"
command-blocklist:
type: "disallowed_commands"
commands: ["cr_comma", "cr_separated", "cr_list_of_commands"]
flipped-rule:
type: "flip"
rule:
type: "allowed_timerange"
time_min: "3:39 AM"
time_max: "3:40 AM"
zone: "America/Chicago"
There are five types of rules which admins can create:
- allowed_weekdays
- allowed_timerange
- disallowed_commands
- flip
- ruleset
- online_player_with_permission
Returns true if the current day of the week is in the week_days
list.
rules:
my-cool-rule:
type: "allowed_weekdays"
week_days: ["MONDAY", "TUESDAY"]
Returns true if the current time is within the provided timestamps.
rules:
my-cool-rule:
type: "allowed_timerange"
time_min: "7:00 AM"
time_max: "8:00 PM"
zone: "EST"
time_min
andtime_max
- Supports 24 hour time.
- When using time periods (AM/PM) ensure there is a space and they are capital.
zone
- Supports long timezones
America/Los_Angeles
(recommended) - Supports time offsets
-05:00
- When using timezones, time offsets are automatically calculated.
- Supports long timezones
Returns true if the command the player executes does not start with any of the provided commands
.
rules:
my-cool-rule:
type: "disallowed_commands"
commands: ["say", "tell", "msg"]
Flips the result of the rule provided in the rule
section.
rules:
my-cool-rule:
type: "flip"
rule:
type: "allowed_weekdays"
week_days: ["MONDAY", "TUESDAY"]
In this case, players are able to talk on days that are NOT Monday or Tuesday.
Goes through the contained set of rules
and will return true if all pass, or false if at least one of them fails.
This is the base structure used in the configuration file.
rules:
my-cool-rule:
type: "ruleset"
rules:
my-cool-rule:
type: "allowed_weekdays"
week_days: ["MONDAY", "TUESDAY"]
my-cool-rule-2:
type: "allowed_weekdays"
week_days: ["SUNDAY", "MONDAY"]
Allows players to talk only if there is a player online with configured permission
.
rules:
my-cool-rule:
type: "online_player_with_permission"
permission: "mycoolpermission.talk"
In this case, if a player is online with the mycoolpermission.talk they will be allowed to speak.
- Bypass All Rules & Restrictions:
chatrestrict.bypass.all
- Bypass Rule:
chatrestrict.bypass.<rulename>
- Reload:
chatrestrict.reload
- Enable/Disable Rules:
chatrestrict.toggle
- See description of rule broken:
chatrestrict.description
- See rules broken by other players:
chatrestrict.description.others
/chatrestrict reload
(Reloads the config)/chatrestrict toggle
(Toggles between chat restricted and chat enabled modes)/chatrestrict enable
(Enables all rules and puts the server in chat restricted mode)/chatrestrict enable <rulename>
(Enables a specific rule to filter chat)
/chatrestrict disable
(Disables all rules and puts the server in chat allowed mode)/chatrestrict disable <rulename>
(Disables a specific rule from filtering chat)
/muteall
(Disables chat, regardless of enabled rules)/unmuteall
(Enables chat and follows enabled rules)
- Push chat messages through to staff who have a specific permission
- Support for DiscordSRV to push chat messages through
- Support for CarbonChat channels
- Support for party, plot, towny, and faction plugins with private chat channels
- Config option to automatically restrict chat when all staff members are offline