MessageFilter
MessageFilter
This plugin brings to you ability to control message in your chat provided from any source. You can hide annoying message of plugin (forever or using cooldown to display it), change any message to another. You can even use MessageFilter as translation tool for plugins that not provides translation mechanics by itself.
Video
Why I need this plugin?
- You would like to hide some spamming message print by plugin you use at your server;
- You would like to replace one message to another;
- You going to translate message of plugin but that plugin is not providing you language-file to edit;
Features
- Hiding messages
- Replacing messages
- Cooldown for message (for example, you don't like to lot of same message, and going to see only one of them during one minute)
- Regex (and other types of string comparison) supported
How it works
All rules added to MessageFilter store in files in "MessageFilter/rules" folder. You can add, modify or remove rules using command or by editing rule files.
Every rule base on some parameters:
- Type — defines the method which will used to determine text in message (before display it on screen). There are five types:
- EQUAL — case insensitive compare (Example: "Aaaa Bbbb" will be equal to "aaaa bbbb")
- CONTAINS — find substring in input-message
- START — check if message starts with provided text
- END — check if message ends with provided text
- REGEX — using regular expression to find matches
- message-mask — defines input mask, that will used to find matches in original message
- replace-to — defines replacement. Replacements supports placeholders %word1% ... %wordN% the will be replaced with conforming word from original message
- cooldown-time — time defined in format similar to time format used in ReActions plugin. Cooldown used to set up time-limit for displaying annoying message. For example, if cooldown time is set to 5 seconds. And "replace-to" mask is empty. Annoying message will displayed only once per five seconds.
When plugin (or other source) is sending message, this message is controlled by MessageFilter and changed according to defined rules. Player will see replaced message instead of original. This methods allows even to translate a plugins that not provides built-in translation for your language. You just need to find messages and create rules to replace it. Here is rule file example: http://dev.bukkit.org/bukkit-plugins/message-filter/pages/main/rule-file-example/
Commands
Main command of plugin is msgfilter (aliases: mfilter, filter).
- /msgfilter help — hmm... h
- /msgfilter add <RuleId> [GroupId] — create new rule
- /msgfilter set <RuleId> type|input|output|cooldown|group <Value> — set parameter (type, input mask, output mask, cooldown time or group) to <Value>
- /msgfilter remove <RuleId> — remove rule
- /msgfilter list [Mask] [PageNumber] — show list of rules
- /msgfilter info <RuleId> — display rule parameters
- /msgfilter save <GroupId> [<Number>|<Time>] — save message into file <GroupId>.yml.
- /msgfilter reload — reload rules
- /msgfilter test — test MessageFilter.
Creating rules
You can create new rules using: command line, incoming chat message and manully editing file.
Examples:
Using commands
- /msgfilter add newrule
- /msgfilter set newrule type EQUAL
- /msgfilter set newrule input this is the input message
- /msgfilter set newrule output &6this is the output message
Save incoming chat message
- /msgfilter save test1 — save next (only one) incoming message to file test1.yml
- /msgfilter save test2 15 — save next 15 incoming messages to file test1.yml
- /msgfilter save test2 10m — save all incoming messages during the 10 minutes to file test1.yml
Manual configuration
MessageFilter supports multiple rules definition files. It's a "YAML" fie (*.yml) located in "rules" folder. You can edit (or create new) this files manually. Here is example:
roadprotector: # rule Id type: EQUAL # rule type message-mask: '&3[RP] &cThis place is protected!' # incoming message (with color code) replace-to: '&6Здесь нельзя ломать и строить!' #outgoing (translated) message cooldown-time: '' # cooldown time use-formating: true # use formatting (colors) removejoing: # rule Id type: REGEX #rule type message-mask: '\w+ joined the server\.' # incoming message, I'm going to hide it replace-to: '' # Empty line cooldown-time: '' use-formating: false # ignore formatting annoying: type: EQUAL message-mask: 'You can\'t build here!' replace-to: '' # Empty line cooldown-time: '5s' #You will see this message only once during the five seconds use-formating: false # ignore formatting
MessageFilter self-test
You can use command /msgfilter test to be sure that MessageFilter works fine. Just type this command in chat. If you receive message "MessageFilter test failed!" usually you need to install or update ProtocolLib.
Permissions
- messagefilter.config — only one permission to access commands.
- messagefilter.test — perform test of MessageFilter when player joins the server.
Dependencies
This plugin requires ProtocoLib installed on your server.
Update checker
MessageFilter includes a update checker that use your server internet connection. Update checker will every hour check the dev.bukkit.org to find new released version of plugin and you can easy disable it: just set parameter "version-check" to "false" in config.yml.
Hi, i want to notify that works very well in version 1.10, but has some minor bugs.
It is a unique plugin, so I hope there are updates in the near future.
PD: Sorry for mi bad english. :P
You have moved to Nukkit, I have heard. Does that mean you won't add any new features to this plugin? If you will still take suggestions, I have one. You could add an every message prefix. The prefix would be displayed before every message, unless it is in the exempt list. The exempt list could look like this:
Prefix: '&bTestServer >> ' Blacklist: 'equal;&6Teleporting...' 'start;&4You do not have permission'
You can use regex, end, start, contains, or equal. Also, if you change 'Blacklist' to 'Whitelist', then only the messages in the whitelist will have the prefix. Also, there is no space between the message(s) and the prefix. If you want a space, you must add a space after the set prefix.
@maxlehot1234 Nukkit is just another part of Minecraft :) After 1.9 release, I created a new plugin - Elytra. So I will update all of my plugins to 1.9 as soon as I can.
@maxlehot1234
it works, BUT players loose 1 item each time the do right-click...
It can not be bug of MessageFilters. It does not have code that works with block placing or player inventory.
@l3enn Version? Server version? ProtocolLib version?
@fromgate
Since you have moved to Nukkit I am guessing that development for this has stopped and there will be no 1.9 update?
If this is the case would it be possible for you to release the source code so that those who want to can update it, or fork it for their own use?
Thank you!
Doesn't work.
Hi the cooldown doesn't work. I am on spigot 1.9.
But other things works great. Any way to fix this please ?
If I use the cooldown, it simply put the original sentence each 5seconds for example if I set the cooldown to 5s.....
Another BUG.
If I want to replace the: you can't place blocks here message on worldguard 6.1 into my language, it works, BUT players loose 1 item each time the do right-click...
This is very bad...
If you doesn't want to update, maybe release the source code so other devs can fix bugs ;)
Thank you and this is a very nice plugin
@zachrywilsn
I'm not planning to made support for bungee. Sorry. Now I moved my attention to Nukkit (server platform for MCPE) and most of development is relates to nukkit.
From my experience this plugin is so unstable: it has given me so much problems since the first config edit, not picking up my changes and modifying hardcoded stuff of other plugins on my server which is a pain to locate and edit again! This resource is NOT safe to use, touches stuff it should NOT touch and the author does not seem to care much about the issues reported, for whatever reason. After 2 months i find myself still waiting for a solution from the author.. For all of you out there researching into this plugin, my suggestion is to install it once it gets updated.
Please fix for bungee servers. When testing this on my Dev server I can not login with this installed even if a fresh install, I will get kicked for this in console and similar on MC Client as a message.
Please updated this to support bungee, seams it does not.
Work fine on 1.8.8 spigot server.
Ideal for wipe the Faction spams message in world where this is not enabled ! (lost power..) Really great and usefull plugins !
Thank for your work !
Whenever I try to use this, the mfilter test doesn't even pass... it doesn't say it failed though. It prints in &4 color "Unknown message (msg_test_fail )" there's some number of spaces after the fail too (not sure how many) (maybe a tab?). I have no idea what's wrong though. I've mixed and matched the versions with various versions of ProtocoLib and cant seem to fix it! I've also switched bukkit and spigot versions around to see if that did anything but nothing seemed to work out. Please help :(
I really need this plugin its super helpful and seems to work great for everyone else!
@DenTsar
I will think about it :)
And one more thing.
Some words from Essentials' messages have dot at the end and it's color can not be modified. Is it possible to make something like a new placeholder to remove 1 symbol from the start and the end of the word. Like the original word is "&aPlayer." With new placeholder it will be able to make from this "&aPlayer." to this "Player" Where you can modify the amount of symbols in the placeholder to be removed
This plugin is just AMAZING! Thank you so much!
As @agronaque512 said, is it possible to add something like %player% or even PlaceholdersAPI (from spigot)?
And also, I found out, that Bungee's messages can not be modified in any way. Is there a way to change them? I really want to get rid of their annoying light-red color style! ;c
Thanks again ^_^
Plugin work fine on spigot 1.8.8R0.1 A really MUST HAVE plugin! But please ADD the variable %player% or something similary or placeholders API support O_O
Hey! Can you add support for multiple lines please (Specifically for the output)?
Can you maby add an bypass permission? I wanted to make some kind of dubble language setup, Then i'll just make all the message English, and translate them to Dutch using this plugin, and i'll give the players that are English (using the hostname they are joining from) the bypass permission.
@fromgate
Hello :D
Thanks a lot everything is working great now ^_^ Plugin is great!
@k256polmrs
Hello!
You must use type REGEX (something like: "\w+ hello") or END (" hello"). In replacement message you must use %word1% placeholder instead of first word of original message: "%word1% hi".
@rysroma
Hello! Your message contains color, but your rule is defined without color code. You can add required codes in your rule or you can set "use-formating: false" to ignore colors.