Cancels the event. A cancelled event is not propagated further to the next listeners, if there's any.
Indicates whether the event has been cancelled. A cancelled event cannot be uncancelled.
public @event void chat(PlayerChatEvent event) { // <player> message event.format = (string name, string message){ return "<" ~ name ~ "> " ~ message; }; // player: message event.format = (string name, string message){ return name ~ ": " ~ message; }; // replace bad words event.message = event.message.replaceAll(ctRegex!("fuck", "i"), "f**k"); }
Called when a player sends a chat message