Package net.luckperms.api.event.context
Interface ContextUpdateEvent
-
- All Superinterfaces:
LuckPermsEvent
public interface ContextUpdateEvent extends LuckPermsEvent
Called when a subject's current/active contexts are updated.There are no guarantees that this event will be called for every update. It is merely to be used as a "hint" for plugins which depend on the current active contexts for a player.
It will always be fired following a call to
ContextManager.signalContextUpdate(Object).The
subjectis always an instance of the platform's subject type. SeeContextManagerfor details.Unlike most other LuckPerms events, this event is not fired asynchronously. Care should be taken to ensure listeners are lightweight. Additionally, listeners should ensure they do not cause further updates to player context, thus possibly causing a stack overflow.
- Since:
- 5.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description @NonNull ObjectgetSubject()Gets the subject whose contexts were updated.default <T> @NonNull Optional<T>getSubject(@NonNull Class<T> subjectClass)Gets the subject whose contexts were updated, casted to a given type.-
Methods inherited from interface net.luckperms.api.event.LuckPermsEvent
getEventType, getLuckPerms
-
-