Ajneb97 / ConditionalEvents

MIT License
22 stars 12 forks source link

Sugestion for a new 'action type': "replace" #27

Closed Tarquitet closed 7 months ago

Tarquitet commented 11 months ago

Like an action type or additional operation like math operations in the conditions.

I was wondering if it was possible to add some functionality related to the 'contains' or '!contains' condition to help when replacing words or other variables sent or executed by the player.

Example: If the player sends a 'bad word' in the chat → it is replaced by another word or '****'. The same would happen with custom fonts, etc.

Obviously, it would be necessary to add a function to save it in a temporary variable or temporary placeholder so that it is compared with another list or call another action in charge of that. Or, it sends it to another plugin (like ServerVariables or EasyCommandBlocker with the TAB function for vault groups) to do a comparison and make the changes by returning it to the event.

Ajneb97 commented 11 months ago

I think you can already do that by using the Formatter expansion from PlaceholderAPI: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/Placeholders#formatter this variable: %formatter_textreplace[target][replacement]%