Skip to content

Events

Two Bukkit events, both in zone.vao.voxen.event.

Fires before delivery. Cancellable, and content is mutable, so this is where you rewrite or drop a message.

Field Type Notes
player Player the sender
channelId String channel the message is going to
content String mutable, the message after the filter ran
recipients MutableSet<Player> remove entries to hide the message from someone
@EventHandler
public void onSend(ChatMessageSendEvent event) {
if (event.getContent().contains("spoiler")) {
event.setCancelled(true);
return;
}
event.getRecipients().removeIf(p -> p.getWorld().equals(nether));
}

Fires after delivery. Everything on it is read-only; use it for logging, Discord bridges and statistics.

Field Type Notes
player Player the sender
channelId String channel it went to
content String the plain text
message Component the fully rendered message
recipients Set<Player> who actually received it
@EventHandler
public void onDelivered(ChatMessageDeliveredEvent event) {
bridge.forward(PlainTextComponentSerializer.plainText().serialize(event.getMessage()));
}