Package net.fabricmc.fabric.api.event
Class Event<T>
java.lang.Object
net.fabricmc.fabric.api.event.Event<T>
- Type Parameters:
T
- The listener type.
Base class for Event implementations.
- See Also:
EventFactory
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
invoker
The invoker field. This should be updated by the implementation to always refer to an instance containing all code that should be executed upon event emission.
-
-
Constructor Details
-
Event
public Event()
-
-
Method Details
-
invoker
Returns the invoker instance.An "invoker" is an object which hides multiple registered listeners of type T under one instance of type T, executing them and leaving early as necessary.
- Returns:
- The invoker instance.
-
register
Register a listener to the event.- Parameters:
listener
- The desired listener.
-