TheNewEconomy (TNE) provides a robust callback system that allows developers to hook into specific points of the plugin's lifecycle. This is in place of using events because this allows TNE callbacks to be the same regardless of platform, whether it's Spigot, Paper, Folia, or Sponge. Callbacks enable you to extend functionality, integrate with external systems, or monitor critical events.
Overview
What is a Callback?
A Callback represents a specific event or action that can trigger custom logic. Each callback is associated with a name identifier and a set of consumers (functions) that handle the event.
Registering a Callback Consumer
To add a consumer to handle its events, you only need a few lines of code: