kangarko / ChatControl-Red

Issue tracker and documentation for the next generation ChatControl Red, the most advanced chat management plugin.
43 stars 22 forks source link

1.20.4: Can we show that player doesn't have perm for specific color? #2628

Closed bobhenl closed 3 months ago

bobhenl commented 3 months ago

Are you using MySQL?

No

Are you using BungeeCord/Velocity?

No

Question

Hello, if the player wants to use colors in chat like &cMESSAGE, can we send him a message that he doesn't have permission for it somehow? Maybe using rules? But wouldn't it be so difficult for the server performance?

kangarko commented 3 months ago

Sorry we don't have these conditions natively, but perhaps you can create a rule in rules/chat.rs that will match all messages and send a message if player does not have the perm

match .*
ignore perm i.must.not.have.this.perm
then warn You don't have the permission!
bobhenl commented 3 months ago

but wait, this matches all messages, how I distinguish if they use & character there?

kangarko commented 3 months ago

Oh sorry, that's correct. Can't you use this?

match (.*)\&c(.*)