Skip to content

How addons work

Bogdan T. edited this page Jun 14, 2025 · 9 revisions

Contents

  1. API
  2. Basics
  3. Available Visor Elements

API

API classes related to lifecycle:

Basics

Addons system is an essential part of Visor architecture.

It allows to modify or extend parts of the Visor without using mixins.

It is built to support many addons at once with compatibility between each other.

Registering & Loading

Addons can be registered via VisorAPI#addonManager() only before VisorClient initialized. All registered addons are loaded during initialization of VisorClient.

Addons cannot be unloaded from Visor for better compatibility, predictability.

Visor Elements and registries

Visor Elements are what you actually use to extend or modify Visor functionality.

Each element can be enabled/disabled and some of them supports priority, that affects on the order at which added elements used.

Each element has its owner, i.e. Addon. And each element has its ID

To add your element to Visor you need to:

  • get instance of registry you need and add your element there
  • If element supports auto-registering, you can use annotation related specifically to that element

For auto-registering to see your elements, you have to correctly specify the addon package path in VisorAddon.class. The path have to not collide with path of any other addon to not cause elements to be duplicated(that will owerride old ones and makes attached to your addon)

What are the element registries?

That is where elements are managed. You can use them to add/remove any element via its ID or remove all elements with specified owner.

Available Visor Elements

Clone this wiki locally