Flectone LogoFlectonePulse

Event reference

Every FlectonePulse event with its fields, from messages and players to lifecycle, modules and proxy

Every event lives in the net.flectone.pulse.model.event package and is written as a record. The cancelled field belongs to every event, so the tables do not repeat it

Field names match method names. The player field is read through event.player(), and a copy with a new value comes from event.withPlayer(...)


Message events

Package net.flectone.pulse.model.event.message

These events run through the pipeline one after another, from preparation to delivery to each receiver

MessagePrepareEvent

Fires once the receivers are counted but nothing has gone out yet. The last moment where you can still change the audience, the metadata or the text

FieldTypeWhat it holds
moduleNameModuleNameThe module that sent the message
eventMetadataEventMetadataHow the message will be delivered
messageContextMessageContextThe message itself
integrationMessageFormatIntegrationMessageFormatThe format for Discord, Telegram and Twitch, or null
receiversSet<FPlayer>The final list of receivers
@Pulse
public Event onPrepare(MessagePrepareEvent event) {
    if (event.moduleName() != ModuleName.MESSAGE_CHAT) return event;

    // drop everyone in creative mode from the receivers
    Set<FPlayer> filtered = event.receivers().stream()
            .filter(receiver -> !isCreative(receiver))
            .collect(Collectors.toSet());

    return event.withReceivers(filtered);
}

MessageFormattingEvent

Fires while the text turns into a component. The main spot for your own MiniMessage tags and text edits

FieldTypeWhat it holds
contextMessageContextSender, receiver, text, flags and tags

Details live on the formatting page

MessageSendEvent

Fires for each receiver as the finished message goes out

FieldTypeWhat it holds
moduleNameModuleNameThe module that sent the message
messageComponentThe main text
submessageComponentThe second text, for example a title subtext
eventMetadataEventMetadataDelivery parameters
messageContextMessageContextThe context of this receiver
@Pulse(priority = Event.Priority.MONITOR, ignoreCancelled = true)
public void onSend(MessageSendEvent event) {
    FPlayer receiver = event.messageContext().receiver();
    getLogger().info(receiver.name() + " got a message");
}

MessageReceiveEvent

Fires when the server is about to show a message to a player. Death, gamemode change or an advancement for example

FieldTypeWhat it holds
playerFPlayerThe receiver
componentComponentThe message
overlaybooleanThe value true draws the message above the hotbar, false puts it in chat

The event also has a getTranslatableComponent() method. It gives the message as a TranslatableComponent, and null when the message is not translatable

@Pulse
public Event onReceive(MessageReceiveEvent event) {
    TranslatableComponent translatable = event.getTranslatableComponent();
    if (translatable == null) return event;

    if (translatable.key().startsWith("death.")) {
        return event.withCancelled(true); // hide death messages
    }

    return event;
}

ProxyMessageEvent

Fires when a message from another server arrives over the FlectonePulse channel

FieldTypeWhat it holds
processedbooleanWhether the message was handled
sentByThisServerbooleanWhether the message came back as an echo from this same server
serverStringThe name of the sending server
nameModuleNameThe module that sent the message
senderFEntityThe sender
uuidUUIDThe shared identifier of every copy of the message
payloadbyte[]Extra data

The openPayload() method opens a ProxyPayload and reads the data in the same order it was written. Details live on the proxy page

StatusResponseEvent

Fires when the server answers a status ping, that is when a player looks at the server in the list. Lets you rewrite the MOTD, the icon and the player counter

FieldTypeWhat it holds
responseObjectThe response object, different on each platform
Warning

The type of response differs between platforms, so cast it only after an instanceof check


Player events

Package net.flectone.pulse.model.event.player

All of them implement PlayerEvent with the player() and withPlayer(FPlayer) methods

EventExtra fieldsWhen it fires
PlayerPreLoginEventkickReason, allowedBefore a player joins, while the connection can still be refused
PlayerLoadEventreloadPlayer data has been read from the database and you can already write to them
PlayerJoinEventnoneA player joined the server
PlayerQuitEventnoneA player left the server
PlayerPersistAndDisposeEventnonePlayer data is being saved and the cache is cleared
Information

PlayerLoadEvent fires after data is read from the database and once more on a plugin reload, where reload() gives true. Take it when you need the settings and colors of a player. PlayerJoinEvent fires only on a real join

@Pulse(priority = Event.Priority.HIGH)
public void onLoad(PlayerLoadEvent event) {
    if (event.reload()) return; // no greeting after a reload

    FPlayer fPlayer = event.player();
    getLogger().info("Loaded player " + fPlayer.name());
}

Lifecycle events

Package net.flectone.pulse.model.event.lifecycle
EventFieldsWhen it fires
EnableEventtype, flectonePulseOn project startup. The INIT type comes before the services start, the READY type once everything already runs
DisableEventflectonePulseOn project shutdown, before components are torn down
ReloadEventtype, flectonePulse, reloadExceptionAt the start of a reload with the START type and at the end with the END type

ReloadEvent also has an isSuccessful() method, it gives true when the reloadException field is empty

@Pulse
public Event onReload(ReloadEvent event) {
    if (event.type() == ReloadEvent.Type.START) {
        // the whole reload can be cancelled
        return maintenanceInProgress ? event.withCancelled(true) : event;
    }

    if (!event.isSuccessful()) {
        getLogger().severe("Reload failed");
    }

    return event;
}

Module events

Package net.flectone.pulse.model.event.module

Both implement ModuleEvent with the module() and withModule(ModuleSimple) methods

EventWhen it fires
ModuleEnableEventBefore a module turns on. Cancelling leaves the module off
ModuleDisableEventBefore a module turns off. Cancelling leaves the module running
@Pulse(priority = Event.Priority.LOWEST)
public Event onModuleEnable(ModuleEnableEvent event) {
    // do not let the bubble module turn on
    if (event.module().name() == ModuleName.MESSAGE_BUBBLE) {
        return event.withCancelled(true);
    }

    return event;
}
Note

Do not forget to return the event from your handler once you change it. How registration and priorities work is written on the event system page

Last update August 11, 2026
Edit on Github

On this page