Closed Nextinka closed 7 months ago
Hello,
Due to how chat components work, each message is split into an array and the [item] has a special mechanism to be replaced. As a result it only works internally in ChatControl. I will be looking forward for a rewrite in the next major version but at present there are no plans.
I plan on dropping Spigot support and using Paper's new chat event for that, however Spigot usage needs to further drop not to alienate my user base.
Are you using MySQL?
Yes
Are you using BungeeCord/Velocity?
No
Question
Hello, I use ChatControlRed as a main plugin for chatting and I take advantage of the variables such as [item] and so on. The problem is that I also have a clan chat that works by hooking into your API, specifically using the ChatChannelEvent. It seems as it applies all the chat rules to it, such as swear filters, however I can't get to work the variables, typing [item] simply does not work - it just returns [item] in the chat. I'm not sure if this is an issue on my end or the event does not support variables at all.
Here is the code that handles the clan chat function:
I tried playing with the priority of the event, but whether it is the lowest or the highest, it still acts the same. I also used raw functions of the event, such as CommandSender, event.getMessage(), event.setMessage() and so on. I'm really clueless about this one, it's probably an easy fix and I can't figure it out. Is it because I am cancelling the event? If so, how do I make it without cancelling the event but making sure that the variables will work and I won't have duplicated messages (one in clan, one in public chat?) Why do the chat rules work in this case but variables won't? Any help will be greatly appreciated!
Using ChatControl-Red-10.23.5