1 Events
Daniella edited this page 2024-05-31 00:26:15 +02:00

Multibus

BaseBand is multibus, meaning there are multiple event systems in place:

  • Forge
  • BaseBand Events
  • Module Events

Only module events continue to work when it is disabled.

Forge

Forge's are nothing special. They use @SubscribeEvent and a parameter.

BaseBand Events

The BaseBand Event system is a bit unusual in that it doesn't actually use annotations. The criteria are instead:

  • return type is void
  • param count is 1
  • Event is assignable from param 1

That's all.

There is a priority system: @Priority(n) where n is a number indicates the priority of this listener. The smallest number is run first. This is perhaps a little confusing and might change in the future.

Module Events

Module events are simply methods every feature can override, that do nothing by default. An example of this is onTick, onEnable, and onDisable. But unlike the other types of events, these can also be run when the module is disabled, e.g. to update GUI state. onEveryTick for example runs regardless of enabled state.