FaroAntiSwear Plugin Features
The
FaroAntiSwear plugin is designed to prevent players from using offensive language in the Minecraft server chat. It automatically detects swear words and enforces actions based on the configuration provided in the config.yml file. The plugin supports customizable messages, actions, and cooldown periods to ensure proper moderation without repeated offenses.
Core Features
- Swear Word Detection: The plugin scans player chat messages for predefined swear words. These swear words are defined in the configuration file. If a player uses any of these words, specific actions are triggered according to the configuration for that swear word.
- Customizable Actions: Each detected swear word can have multiple associated actions, such as:
- Warning: The player is warned for using offensive language.
- Temporary Mute: The player can be muted for a set amount of time (e.g., 15 minutes).
- Chat Deletion: The offensive message can be deleted automatically from the chat.
These actions are configured in the config.yml file under each swear word’s section (command, command2, command3).
- Cooldown System: After a player uses offensive language and receives a penalty (like a temporary mute), the plugin prevents the same player from being penalized again for a defined period. This cooldown period is customizable in milliseconds (default is 15 minutes or 900000 ms). During this cooldown, the player will not receive further penalties for swearing, even if they continue to use offensive language.
- Customizable Messages:
- Warning Message: A customizable warning message is sent to players when they use offensive language. The default message is: "Please do not use offensive language!"
- No Permission Message: Players without permission to use certain commands will see a custom message: "You do not have permission to use this command."
- Reload Message: When the plugin’s configuration is reloaded, a confirmation message is shown: "Configuration reloaded successfully."
- Muted Message: Players who are muted for offensive language will see a message informing them of the mute duration: "You are still muted for offensive language."
- Command Integration: The plugin can execute different commands based on the offensive words used. For example:
- kick %player% Offensive language: Kicks the player from the server.
- tempmute %player% 15m swear (%message%): Temporarily mutes the player for 15 minutes and includes the offensive message in the mute reason.
- warn %player%: Warns the player.
- chatdelete: Deletes the offensive chat message.
These commands are defined for each swear word and can be customized or left empty if no action is desired.
- Command Reload: The plugin has a reload command that allows server administrators to reload the configuration file without restarting the server. This is useful for quickly changing the behavior of the plugin without downtime.
- Bypass Permission: Some players or staff members may need to bypass the swear word filter. For example, administrators or trusted players with the faroantiswear.bypass permission will not be penalized for using offensive language.
- Permissions System:
- faroantiswear.reload: Allows players to reload the plugin configuration.
- faroantiswear.bypass: Grants bypass permissions to specific players, preventing the plugin from taking action against their messages.
Configurable Settings in config.yml
- Swear Word Definitions: Each swear word is defined with an associated set of commands. You can define multiple swear words with their respective actions.
- command: Primary action (e.g., mute the player).
- command2: Secondary action (e.g., warn the player).
- command3: Optional tertiary action (e.g., delete the message).
- Cooldown: The cooldown duration, defined in milliseconds, sets how long a player must wait before the same actions can be applied again after swearing.
- Messages: Customize all plugin-related messages, including warnings, no-permission alerts, reload notifications, and muted player messages.
Usage Example (config.yml):
yaml
1:
swear: "fuck"
command: "tempmute %player% 15m swear (%message%)"
command2: "warn %player%"
command3: "chatdelete"
2:
swear: "pussy"
command: "tempmute %player% 15m swear (%message%)"
command2: "warn %player%"
command3: "chatdelete"
messages:
warningMessage: "&cPlease do not use offensive language!"
noPermission: "&cYou do not have permission to use this command."
reloadMessage: "&aConfiguration reloaded successfully."
mutedMessage: "&cYou are still muted for offensive language."
cooldown: 900000 # 15 minutes in milliseconds
How It Works:
- When a player types a message containing a swear word, the plugin checks the list of words defined in the configuration.
- If a match is found, the configured actions are triggered (mute, warn, delete message, etc.).
- The plugin enforces a cooldown period to prevent repeated punishments within a set time frame.
- Administrators can reload the plugin configuration with the /faroantiswear reload command, updating settings without restarting the server.
Conclusion:
FaroAntiSwear helps maintain a respectful environment on your server by automatically detecting and acting upon offensive language. The plugin is highly configurable, allowing you to customize the behavior, actions, and messages according to your server's needs.