> For the complete documentation index, see [llms.txt](https://hayston.gitbook.io/flp-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hayston.gitbook.io/flp-wiki/developer-documentation/extensions.md).

# Events and extension boundaries

Classic events use core interfaces and platform-specific implementations. Depend on the actual platform event class when registering a listener; a core interface is not itself a Bukkit `Event`. Folia has the mirrored Bukkit event classes with its own runtime threading constraints.

| Core contract                 | Purpose                                                            | Important boundary                                                                 |
| ----------------------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------- |
| `FastLoginPreLoginEvent`      | Observe username/source/profile before online-mode routing actions | Not authentication proof; no generic cancellable contract                          |
| `FastLoginAutoLoginEvent`     | Intercept applicable forced auto-login                             | Cancellable; not a universal event for every registration/early AuthMe/Fabric path |
| `FastLoginPremiumToggleEvent` | Observe list-state changes and reason                              | A change notification, not a new trusted identity                                  |
| `FastLoginAntiBotEvent`       | Intercept a connection-limit rejection                             | Cancellation permits continuation; listeners can weaken admission protection       |

Implementations live in each platform's `event` package. Events can fire asynchronously; follow the platform's threading and scheduling requirements when using its APIs.

## Integrating authentication

`AuthPlugin` and related interfaces expose account queries and login actions. Integrations must distinguish read failure from an absent account, check ownership and confirm the authentication plugin's action result.

Custom management tools should use authorized operations and preserve account-owner consent and password protection, rather than bypassing them with direct database edits.

## Protocol changes

Change the shared `protocol` contracts and test both Velocity and Fabric's generated copy. Validate origin, freshness, name/UUID/connection association, policy completeness and duplicate handling. A plugin message is not inherently authenticated because it used an FLP channel name. Preserve the established `fastloginplus:force` format unless a separately designed compatible migration is authorized.

Fabric's internal gate/bridge is not an advertised stable public event API. Do not promise parity with classic plugin events or wire out-of-tree mods to reflective internals without a defined compatibility contract.

Before changing an integration, see [build and contribute](/flp-wiki/developer-documentation/build.md) and [login flow](/flp-wiki/developer-documentation/login-flow.md), and add or adjust tests for the behavior affected.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hayston.gitbook.io/flp-wiki/developer-documentation/extensions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
