Readonly
modifiedThis 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.
Readonly
modifiedThis 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.
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");
}
};`);
Readonly
modifiedThis 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.
Static
Readonly
instanceThe instance of the andexdbBeforeEvents
class.
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)