promotional bannermobile promotional banner

[1.8.9] ChatFilter

A simple, command based, clientside chat filter mod using Regex.

Due to the cluttered chat on Hypixel Bedwars, i was searching for a simple chat filter and replacement mod for 1.8.9. I was surprised to find out that there arent any that work well.
So, i present:

Strableg's ChatFilter!


Features

 

Purely clientside, made for use on any server.
This Mod only affects the chat on your side, so it is allowed on every server!

Filtering is based on Regex, which a lot of people already know.

Many different filters with more to come:

  • Hide: Completely hides matching messages
    • Replace: Replaces a matching message with another one via regex
    • Summarize: Summarizes many simmilar Messages into a single one
    • Preset: Manages entire sets of filters

 

A rich /command interface, providing functionality for

  • Adding, removing and renaming filters
  • Grouping filters in so called Presets
  • Autocomplete for easier use
  • Saving and reloading the running config (or letting the mod automatically do so on start and exit)
  • Listing and filtering through all created rules
  • Enabling and disabling single filters or entire presets
  • Replacement messages can include Formatting Codes (Color & Font styles)

 

How to use

 

Simply type /cf in the chat. The Syntax is very self-explanatory. It only requires a little knowledge of Regex.

 

What the duck is Regex?

 

Regex stands for regular expression and is a simple and consise way to describe the syntax of a text.

At the start of this project, i never wrote a regular expression in my life, but its a matter of maybe 30 minutes to learn.

I recommend asking ChatGPT for a specific filter and the using regex101 to better understand it.

 

Adding filters

 

Example: Removing Hypixels annoying "[MVP+] PlayerXYZ slid into the lobby!" Messages.

 

The syntax for this is /cf add <filter name> <regex pattern> 

So i would type: /cf add hypixel_lobbyJoin ".* slid into the lobby!.*"

 

Every message containing the string "slid into the lobby!" is now hidden! But what about replacing them?

 

To do so, simply specify you want to add a replace-filter: /cf add <filter name> <regex pattern> replace <replacement>

Like this: /cf add hypixel_lobbyJoin ".*(\[.*\].*) slid into the lobby!.*" replace "$1 joined!"

Now everytime someone joins the lobby you will see this message: "[MVP+] PlayerXYZ joined!"

 

Easy, right? But the replacement looks boring, so lets color it a bit by using color codes!

 

Like this: /cf add hypixel_lobbyJoin ".*(\[.*\].*) slid into the lobby!.*" replace "&3&l$1 &ejoined!"

 

Example: Summarizing all those "+XXX coins! (Triple Coins + EXP, Network booster, etc.)"

 

You can achieve this by adding a summarize-filter: /cf add <filter name> <regex pattern> summarize <summarizing message> <delay in client ticks>

For example: /cf add hypixel_coins "\+(\d+) coins?!.*" summarize "&6+$1 coins in the past 30 seconds!" 1200

 

 

Managing filters

 

To view all your filters, simply type /cf list.

 

If you want to disable or reenable a filter, you can do so by typing /cf enable <filters...> or /cf disable  <filters...>

 

Note that you can also use Regex to enable and disable filters. Here i enable all filters starting with "hypixel_": /cf enable hypixel_.*

 

Here i disable all filters by typing using the ".*" regex: /cf disable .*

 

You can also just disable/ enable filtering by the mod overall by typing /cf disable or /cf enable.

 

If you want to use filters together, you can add them to a preset: /cf preset <preset> add <filters...>

Here, i add all hypixel related filters to a preset called hypixel: /cf preset hypixel add hypixel_.*

 

You can now check out the newly created preset with /cf list. If you want to check the rules contained in it, you can use /cf list preset=hypixel

 

Listing filters

 

/cf list has a few different options that will change whats listed and that can be combined. If you type "/cf list " and press tab, all filters will be suggested.

 

Example: /cf list preset=hypixel name=bedwars_.* enabled hide verbose will list all filters in the preset "hypixel" that have a name starting with "bedwars_" and are enabled and are hiding filters. It will also describe the filters very verbose

 

When listing filters, they either have a red, yellow or green name.

  • Green means the filter is enabled and active
  • Yellow means the filter is not enabled, but still active (because a preset containing the filter is active)
  • Red means the filter is disabled and inactive

 

If you want to rename a filter, you can by using /cf rename <filter> <new name>.

 

 

 

 

Thanks to leaf for the inspiration through their chatfilter 2.0 Mod! This was the only usable chat filter mod i have found, which inspired me to make this.

 

Feel free to ask questions in the comments. A port to any other game version is not planned as of now.

 

This Description will be updated soon.

 

The [1.8.9] ChatFilter Team

profile avatar
  • 1
    Projects
  • 1.0K
    Downloads