Events - 0x3C50/Renderer GitHub Wiki

Events are used by the library to broadcast certain things happening. Currently, only 2 events are used: WORLD and HUD render events.

This library uses fabric's event system, more information on it specifically can be found on their docs.

Available events

The available events can be found in RenderEvents, and currently are WORLD and HUD.

Registering

To subscribe to an event, use RenderEvents.EVENT_TYPE.register(matrixStack -> {});. The lambda is the event listener, and gets called with the relevant MatrixStack once the event gets emitted.

Unregistering

You can't stop a registered event from listening, but you can make it stop executing. If your method should only run based on some condition, add a check for that condition at the top of your listener and return; if it isn't met.