ByteLib Documentation 1.1 Help

Lifecycles API

The Lifecycles API allows plugins to define multiple onLoad(), onEnable(), and onDisable() handlers instead of placing all lifecycle logic in a single class.

This makes it easier to decouple plugin initialization and shutdown logic, allowing different parts of your plugin to manage their own lifecycle responsibilities.

While some developers split lifecycle logic into helper methods within a single class, ByteLib takes this approach further by allowing lifecycle behavior to be implemented in entirely separate classes.

Why use lifecycle classes?

Splitting lifecycle logic into dedicated classes improves the structure and maintainability of larger plugins.

  • Reduces large and difficult-to-maintain onEnable() methods.

  • Encourages separation of responsibilities between plugin systems.

  • Allows lifecycle behavior to integrate naturally with dependency injection.

10 March 2026