Manages callbacks that are connected to an event that fires before modified chat messages are formatted.
These callbacks are triggered by the chat ranks system of the add-on, if the chat ranks system is disabled these callbacks will never fire.
function preventMessagesContainingHerobrine() { const chatCallback = Events.andexdb.beforeEvents.modifiedChatMessageFormat.subscribe(`(eventData) => { if (eventData.message.includes("Herobrine")) { eventData.cancel = true; } }`);} Copy
function preventMessagesContainingHerobrine() { const chatCallback = Events.andexdb.beforeEvents.modifiedChatMessageFormat.subscribe(`(eventData) => { if (eventData.message.includes("Herobrine")) { eventData.cancel = true; } }`);}
function replaceEveryAInMessagesWithB() { const chatCallback = Events.andexdb.beforeEvents.modifiedChatMessageFormat.subscribe(`(eventData) => { eventData.message = eventData.message.replaceAll("a", "b"); }`);} Copy
function replaceEveryAInMessagesWithB() { const chatCallback = Events.andexdb.beforeEvents.modifiedChatMessageFormat.subscribe(`(eventData) => { eventData.message = eventData.message.replaceAll("a", "b"); }`);}
Static
The callbacks that will be called before new modified chat messages are formatted.
Adds a callback that will be called before new modified chat messages are formatted.
This function can be called in read-only mode.
This function can be called in early-execution mode.
Removes a callback from being called before new modified chat messages are formatted.
This function can't be called in read-only mode.
Manages callbacks that are connected to an event that fires before modified chat messages are formatted.
These callbacks are triggered by the chat ranks system of the add-on, if the chat ranks system is disabled these callbacks will never fire.
Example: preventMessagesContainingHerobrine.ts
Example: replaceEveryAInMessagesWithB.ts