YetAnotherSwearingFilter
YASF: Yet Another Swearing Filter
YASF is yet another swearing filter, which has advanced, built-in "Smart Filters" along with the ability to create your own custom Filters. YASF also allows you to choose which Actions to take when a violation is detected (kick, kill, burn, ban, deop, send a message to the player, and/or any number of custom server actions).
Features
- Advanced "Smart Filters" (see below), along with user-defined RegEx (regular expression) Filters;
- Blocks commands that contain swear words (via a server customizable list);
- Applies various actions when a violation occurs (kick, kill, burn, ban, deop, send message, and/or run custom server commands);
- Optionally bans players that receive too many swearing violations (configurable), or applies a set of custom actions and commands;
- Optionally bans players from joining the server if their name contains one of the defined swear words (configurable; you can also provide a list of players that are excluded from this check if this is enabled);
- Ability to add your own custom words (rules) to the list (using regular expressions).
Currently there are eleven built-in Smart Filters to choose from (you may define your own custom filters as well; a dozen custom filtered words are included in the default "filters.yml" file, both as examples and as additional words to filter on), which filter not only on the word itself but also on many variations of that word. All filters (custom and built-in) are case-insensitive and automatically take into account accented characters. For example:
- the word "Duck" might filter on: duck, duk, dvck, d*u*c*k, d uck, dűćķ, d\_/ck, ddddddduuuuuucccckkkkk, etc.
- the word "Shot" might filter on: shot, sh0t, $hot, s*h*o*t, s h o t; BUT NOT phrases like: it's hot.
- the word "All": might filter on: all, allhole ;-) BUT NOT words like: call, or ball, or alloy.
- similarly, for a word that could be both a person's name and also an offensive word depending on its usage (i.e., Dick), the built-in Smart Filter makes an attempt to determine the usage/intent and filter accordingly. Note: because some sentences with this name/word could be interpreted either way, there are situations where this filter won't correctly identify the negative usage (you can define your own custom filter if you prefer a more strict filter for this case).
You can also choose how many swearing de-merits should be given for any set of words (e.g., more severe words can receive more de-merits than less derogatory words).
Commands
- /yasf - prints out the user's current number of violation demerits.
- /yasf test <phrase> - [admin console only] allows you to test words/phrases against the currently running swear filters.
- /yasf player <playerName> - [admin console only] queries how many de-merits the given player currently has.
- /yasf setplayer <playerName> <demeritCount> - [admin console only] sets the number of de-merits for the given player.
- /yasf reload - [admin console only] reloads the plugin and all configuration and rule changes.
Configuration
See (edit) the filters.yml file for instructions on configuring your own Rules and Filters (the defaults may be fine for many people).
Warning: The "filters.yml" file contains offensive language, as all of the swear words to filter on are configured there.
How to Install
- Drag and drop the .jar file into your plugins folder.
- Stop and restart your server, or "/reload" the plugins while your server is running. The initial filter defaults are now active.
- Set up the "filters.yml" file however you want (define your own filters and/or use the built-in ones), and type "yasf reload" from the server console (or use "/reload" to reload all of the plugins) for the new settings to take effect.
Note: to unban someone that has been automatically banned from the server for too much swearing, you'll need to manually edit the "warnings.yml" file. Beside the players' names are the number of violations they currently have. Reset or lower that number to below the ban-threshold.
Examples
The default "filters.yml" file contains documentation and examples on how to create Rules, how to use the built-in smart filters, how to create your own custom filters (which utilize powerful "regular expressions"), and how to define what Actions to take (including defining your own custom actions).
See also this page for more information: Usage-Examples
Please report any inaccuracies in the filters so that they can be corrected as quickly as possible. Thanks.
Note: this plugin sends usage data to MCStats (see: http://mcstats.org/plugin/YetAnotherSwearingFilter).
My server provides more than a third of the plugin's players :D http://mcstats.org/plugin/YetAnotherSwearingFilter http://minecraftservers.org/server/114360
@MeJellyPelly
Does not happen to me...
This seems to clash with CoreProtect ... i.e. CoreProtect stopped recording as soon as we installed YASF. Is there a fix for that? There didn't seem to be any errors in the console log ...?
Does YASF integrate with PEX? What is the node?
PLEASE never abandon this #1 plugin!!!! This is the ONLY effective swearing filter I have found!
Feature request: YASF (yet another spamming filter) All of the spam plugins I have found HATE me!
Please update this to 1.8, I really want to use it for the next update. Also, I would suggest that you update it every update.
Thanks
Would this happen to work with 1.7.2+? It sounds quite interesting, but I haven't the time to check.
@Hangar
I ran some tests on my code using "§fagain" as the input string, and it did not detect the word "fag" (which it shouldn't). The ChatColor.stripColor() function does strip out the leading "§f" character code properly, at least in my tests (are you using a different character code to denote colors?)
Do you happen to still have the line of text that was being filtered (it should show up in your server.log file)? If so, could you forward that on to me? I'd also be interested to know if you created your own custom regex's (or modified any of the original ones), as it's quite easy to miss something in a regex statement.
Submitted a feature request on the forum area, in case you didn't see! <3
@Hangar
Hm - thanks, I'll look into that one. I do call bukkit's ChatColor.stripColor() function before running the swear filters on the text, so I thought that should take care of the color codes, but I'll run a few tests to see what might be going on and try to fix that.
I might have a bug for ya. My chat plugin puts the color code "&f" at the beginning of every line to reset their chat text to white after doing the prefix colors. I think that's something a lot of chat-related plugins might do too. Anyway, I suspect your plugin is reading the color code "&f" as the letter "f" as if the user typed it at the beginning of their line. It tripped off a "fag" filter when someone was saying "again."
Thanks.
@Hangar
Some of the commands, such as "yasf test", currently work only from the server console (i.e., not from within the player's console). These are marked by "[admin console only]" in the documentation, above.
All of the censoring is currently logged to bukkit's default "server.log" file. What I've done before is to search the "server.log" file directly. E.g., in linux:
cat server.log | grep YetAnother
As for "resetWarnings", I checked the source and noticed that it currently is checking for the all lowercase version ("resetwarnings"). I've updated the code to support both alternatives, which will take effect in the next update.
I tried using resetWarnings and get this on reload:
WARN]: Uknown rule action found: resetWarnings
EDIT: I think it works with all lowercase.
- I'm also wondering if the things they say can't be logged (with no censoring) to a text file in the plugin folder. I'm trying to see why these people got banned when testing and it's a little unclear in one case.
- Finally, I tried /yasf test word-that-i-know-bans-you and it just says I have 0 demerits if I'm in the exceptions & exclusions lists. If I remove my name from them, I actually GET banned, which isn't much of a test at all :/
http://pastebin.com/1fAub2KV
Thanks.
@dexserver
You're a lifesaver, thanks a bunch for the quick response :D
@dulceice
I guess the filters.yml config file doesn't like blank entries (I'll make the error message more friendly in the next release).
On your second filter you have both a "filter:" and a "regexFilter:" defined, but the first "filter:" doesn't contain any entries. Just remove that line and start with:
- regexFilter: dou.......
This is absolutely the plugin we were looking for on our server, but we're getting an error when I try to reload that renders it unusable.
[starts at bottom] http://pastie.org/private/qvpxcrq0xivoodoxl4bqga
Here's the config file [obligatory language warning] http://pastie.org/private/zgyjoqjjxaerrkpenzdg
Help please! D: Sorry if it's caused by some stupid error on my part.
@dexserver
Thanks, dude! :)
@WauloK
D'oh. The most recent update (1.3.2, which I've compiled against Bukkit 1.6.4R2) has debug/trace logging disabled.
Hi!
Why does YASF fill my console with:
09:31:08 [INFO] JWA -> MrtomkinsonCam
09:31:08 [INFO] JWA -> MrtomkinsonCam
09:31:08 [INFO] JWA -> MrtomkinsonCam
09:31:08 [INFO] JWA -> MrtomkinsonCam
09:31:08 [INFO] JWA -> MrtomkinsonCam
09:31:08 [INFO] JWA -> MrtomkinsonCam
09:31:08 [INFO] JWA -> MrtomkinsonCam
09:31:08 [INFO] JWA -> MrtomkinsonCam
It does that when people JOIN and whenever they TALK and for each command they execute.
@OmniscientHF
OK. I've got a minor update (version 1.3.1) that I'm just testing out on my server for a couple of days, which will allow you to exempt certain players from being filtered (you provide a list of player names) and/or exempt all operators from being filtered (i.e., they will be allowed to use any of the configured swear words).
Also, if you have players whose name's are deemed offensive by the word filters, you can still allow them to join the server and allow other players to interact with them: any command (mail, say, tell, etc.) with their name in it won't be filtered / flagged due to their name being in the command.