This event is triggered before a modified chat message is formatted.
This is triggered by the chat ranks system of the add-on, if the chat ranks system is disabled this event will never fire.
This property can be read in early-execution mode.
Gets all event subscriptions to this event type.
The event subscriptions.
Creates a new event subscription.
Deletes the provided event subscription.
This event is triggered before a formatted chat message is finalized.
This event allows you do do things like change the evaluated ranks, name tag, and more.
This is triggered by the chat ranks system of the add-on, if the chat ranks system is disabled this event will never fire.
This property can be read in early-execution mode.
Gets all event subscriptions to this event type.
The event subscriptions.
Creates a new event subscription.
Deletes the provided event subscription.
function changeDisplayNamesOfPlayersSendingMessagesContainingHerobrine() {
const chatCallback = Events.andexdb.beforeEvents.modifiedChatMessageFormatFinalization.subscribe(`(eventData) => {
if (eventData.tokenData.message.includes("Herobrine")) {
eventData.tokenData.name = "<Herobrine>";
eventData.tokenData.nameb = "Herobrine";
}
}`);
}
function addAAAARankToAllMessages() {
const chatCallback = Events.andexdb.beforeEvents.modifiedChatMessageFormatFinalization.subscribe(`(eventData) => {
eventData.tokenData.ranks.push("AAAA");
}`);
}
function messUpPlayersMessagesIfTheySetMessUpMyMessages() {
Events.andexdb.beforeEvents.modifiedChatMessageFormat.subscribe(`(event) => {
if (event.message.includes("mess up my message")) {
event.message = event.message
.replaceAll(/([a-z])([a-z])([a-z])([a-z])([a-z])/g, "$5$3$4$2$1")
.replaceAll(/([a-z])([a-z])([a-z])/g, "$3$1$2")
.replaceAll(/([a-z])([a-z])/g, "$2$1");
}
};`);
This event is triggered before a modified chat message is sent.
This is triggered by the chat ranks system of the add-on, if the chat ranks system is disabled this event will never fire.
This property can be read in early-execution mode.
Gets all event subscriptions to this event type.
The event subscriptions.
Creates a new event subscription.
Deletes the provided event subscription.
A set of events that fire before an actual action occurs. In most cases, you can potentially cancel or modify the impending event. Note that in before events any APIs that modify gameplay state will not function and will throw an error. (e.g., dimension.spawnEntity)