PR: https://github.com/PaperMC/Paper/pull/9629
Full doc: https://gist.github.com/Machine-Maker/8e3fc6063c98e81cae7cee1ac230936f
This is a new event system required for events during early initialization. The 2 currently planned uses are for the Brigadier Commands API ( #1121227200277004398 ) and the Registry Modification API ( #1179518554702348319 ). The gist linked above has the full rundown on what this is, why its needed, and how its used. The TL;DR version, is that the existing event system is not designed for operation before the server has been initialized which happens too late during server startup for key events that plugin bootstraps might want to listen to.
The registration of event handlers can happen in 2 places, in PluginBootstrap#bootstrap or in JavaPlugin#onEnable. Event types will support registration of handlers in one or both of those places.
Here is an example of the event system being used in JavaPlugin#onEnable to handle command registration.
@Override
public void onEnable() {
final LifecycleEventManager<Plugin> manager = this.getLifecycleManager();
// register a handler for the command event which provides the "Commands" interface for
// registering new commands
manager.registerEventHandler(LifecycleEvents.COMMANDS.newHandler(event -> {
final Commands commands = event.registrar();
commands.register(this.getPluginMeta(), "some-command", (commandSourceStack, args) -> 1);
}).priority(100)); // sets a priority of 100. Some events have priorities, some don't
manager.registerEventHandler(LifecycleEvents.COMMANDS.newHandler(event -> {
final Commands commands = event.registrar();
}).monitor()); // sets this handler as a monitor so it runs last (should only be used for reading information)
}
The complete write-up for this system is available here

