Idea: Custom scripts
LWJENNI opened this issue ยท 1 comments
๐ Feature Proposal: Custom Script Support for ChatPatches
Hi!
Iโd like to suggest an idea for the ChatPatches mod โ adding support for custom scripts for client-side chat message handling.
๐ Idea:
Introduce support for writing custom JavaScript scripts that can handle client-side events like:
- Receiving chat messages
- Displaying boss bars
- Handling titles
- Scoreboard updates
This system would allow players to:
- Automatically remove ads or unwanted messages from the chat
- Hide boss bars or titles based on conditions
- Filter messages by keywords
- Customize how chat messages appear
๐ How It Could Work:
-
Add a "Scripts" section in the mod settings, where players can:
- Create new scripts (with a custom name)
- Edit the script code (written in JavaScript)
- Delete scripts
- Enable/disable scripts individually
- Specify the server IP where each script should be active
-
Provide built-in documentation listing the available API methods and events, for example:
onChatMessage(callback)getServerIp()event.messageevent.remove()- and others
๐ฆ Example Use Case:
A player could write a script like this:
onChatMessage(function(event) {
if (getServerIp() === "example.net") {
if (event.message.includes("advertisement")) {
event.remove();
}
}
});This would automatically remove any chat message containing the word "advertisement" when connected to "example.net".
Optionally, it could capture the next 5 messages or perform additional actions.
๐ Why This Would Be Useful:
- It gives players a flexible, scriptable way to control their client chat experience.
- Users could tailor chat behavior to specific servers.
- Can help block spam, manage boss bars, or automate message formatting.
- No need to edit mod code โ scripts are fully managed through the UI.
Iโm not sure how exactly to implement this yet, but Iโd love to see a feature like this added to ChatPatches.