Discord: Click Here AboutSafeChat: SafeChat is a chat moderation plugin built to make your server a safer place. This plugin has had a lot of work put into it by me and its main contributor,
Jochyoua. If it wasn't for him, SafeChat wouldn't look like this.
Author's notes: This plugin is open-sourced, under the
GNU General Public License Version 3.0. Feel free to propose a
Pull Request.
This plugin has been tested through versions 1.17 to 1.20.5
SafeChat is also compatible with Java versions 17 to 21.
This plugin will do it's best to catch and prevent unwanted messages from being sent, although there might be false positives or bypasses.
If you encounter any issues you can tweak the configurations to your likings and we provide an API for you to make your own checks.
If you encounter any issues, please make a new
issue here Features These are some of the current features:
Localization: This allows you to edit any message that is seen by your players. Learn more here: README.md
Addresses Check: This check attempts to stop all addresses from being sent into chat. IP addresses are also filtered and without bypass permissions the message will be blocked and the user will be punished.
Repetition Check: This check is configurable and blocks the user from sending messages that are too similar, or identical, to the previous one.
Flood Check: This check prevents users from flooding the chat with messages when writing too fast. It is configurable and will block all users that are sending too many messages in a short time
Blacklist Check: This check allows you to define custom words to be blocked. When a player writes a message that contains any of these words it will be blocked and the user will be punished. A minimal default list is generated by default
Caps Check: This check verifies that the message doesn't contain too many upper-case characters. You can configure a maximum amount of uppercase characters in the configuration, any more than the max will result in the message not being sent.
Storage This plugin does require a storage in order to work and use all functionalities!
You can pick between an approved list of databases:
MySQL
MariaDB
H2
CockroachDB
PostgreSQL
HyperSQL
Microsoft's SQL Server
IBM DB2
The storage feature will use java persistence to save flags, warning , and other data. The plugin is not responsible for eventual data loss and future updates may completely change the dataset.
COMMAND DESCRIPTION PERMISSION
safechat help Show all available commands safechat.commands.help
COMMAND DESCRIPTION PERMISSION
safechat version Returns the current version safechat.commands.version
COMMAND DESCRIPTION PERMISSION
safechat flags Calculates a player's flags for a check safechat.commands.flags
Configurations: This plugin uses the TOML configuration system.
Here are the samples of the default configs provided by this plugin.
# A list of allowed domains
# (no, wikipedia and hypixel did not sponsor me).
[domains]
allowed = [
"wikipedia.org",
"hypixel.net"
]
# A list of allowed addresses
[address]
allowed = [
"127.0.0.1",
"0.0.0.0"
]
[blacklist]
enable-check = true # whether the check should be enabled
enable-warning = true # whether the check should produce a warning
enable-logging = true # logs each violation into /plugins/SafeChat/logs/checkLogs.log
fallback = true # whether to fallback upon regex if all other filtering fails
allow-similarity = false # try to match words similar to the ones currently blacklisted
# similarity factor indicates how close should a word be similar
# to a blacklisted word to be catched by the plugin.
# 1.00 indicates identical, while 0.00 indicates any word.
# A recommended value would be between 0.75 and 0.90
# This disabled regex fallback as well
maximum-similarity = 0.850
punish-after = 5 # how often does a player get punished for failing this check.
punish-command = 'kick {PLAYER}' # the command executed when player needs to be punished,
[address]
enable-check = true # whether the check should be enabled
enable-warning = true # whether the check should produce a warning
enable-logging = true # logs each violation into /plugins/SafeChat/logs/checkLogs.log
punish-after = 5 # how often does a player get punished for failing this check.
punish-command = 'kick {PLAYER}' # the command executed when player needs to be punished,
[flood]
enable-check = true # whether the check should be enabled
enable-warning = true # whether the check should produce a warning
enable-logging = true # logs each violation into /plugins/SafeChat/logs/checkLogs.log
required-delay = 1.50 # the minimum delay in seconds required to write a new message.
punish-after = 5 # how often does a player get punished for failing this check.
punish-command = 'kick {PLAYER}' # the command executed when player needs to be punished,
[repetition]
enable-check = true # whether the check should be enabled
enable-warning = true # whether the check should produce a warning
enable-logging = true # logs each violation into /plugins/SafeChat/logs/checkLogs.log
allow-similarity = false
maximum-similarity = 0.70
punish-after = 5 # how often does a player get punished for failing this check.
punish-command = 'kick {PLAYER}' # the command executed when player needs to be punished,
[caps]
enable-check = true # whether the check should be enabled
enable-warning = true # whether the check should produce a warning
enable-logging = true # logs each violation into /plugins/SafeChat/logs/checkLogs.log
uppercase-characters-limit = 8 # maximum allowed number of uppercase characters in a message.
punish-after = 5 # how often does a player get punished for failing this check.
punish-command = 'kick {PLAYER}' # the command executed when player needs to be punished.
# Messages for all of the default checks
# available placeholder:
# {PREFIX} -> The prefix of this plugin (SafeChat)
# {PLAYER} -> The name of the player who failed the check.
# {TIME} -> missing time to write again (ONLY WORKS FOR CHAT FLOOD!)
[messages]
locale = "en"
address-warning = [
"{PREFIX} &7You have sent a forbidden address in chat.",
"&7Please &e{PLAYER}&7, don't do that again!"
]
blacklisted-word-warning = [
"{PREFIX} &7You have used a forbidden word in your message.",
"&7Please &e{PLAYER}&7, don't use that word again!"
]
text-repetition-warning = [
"{PREFIX} &7You have written similiar messages twice.",
"&7Please &e{PLAYER}&7, write something different!"
]
chat-flood-warning = [
"{PREFIX} &7You have been sending messages too fast.",
"&7Please &e{PLAYER}&7, wait &f{TIME} &7to write again!"
]
caps-warning = [
"{PREFIX} &7You have been using too many uppercase characters.",
"&7Please &e{PLAYER}&7, disable your caps lock!"
]
# A list of blacklisted words
words = [
'poop',
'shit',
'fuck',
'nigger',
'nigga',
'cunt',
'hoe',
'bitch',
'idiot',
'asshole',
"boob",
"jerk",
"slut",
"piss",
"prick",
"whore",
"twat",
"cock",
"ass"
]
# Settings for your database
[database]
sql-flavor = 'h2' # The type of your sql
username = 'root' # your database user name
password = 'password' # your database user password
db-name = 'my-database' # your database name
port = 3306 # the port used by your database
address = '127.0.0.1' # the address used by your database
timeout = 1500 # timeout in milliseconds for unresponsiveness
filepath = './plugins/SafeChat/safechat' # (only for file-based databases) don't modify if you don't know what it does.