Interface TriggerActivatingCondition
- All Superinterfaces:
EventListener
- All Known Subinterfaces:
TriggerListener
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
This listener provides a callback that allows to check conditions for activating a
Trigger
and prevent the activation if necessary.-
Method Summary
Modifier and TypeMethodDescriptioncanActivate
(TriggerEvent event) Allows to register functions that contain additional checks for the trigger activation.
-
Method Details
-
canActivate
Allows to register functions that contain additional checks for the trigger activation. The return value of the function is considered the reason why the trigger cannot be activated. If the function returns anything else than null, the activation is cancelled and the result of the function is send to the activator entity.- Parameters:
event
- The event data that contains information about the trigger.- Returns:
- The reason why the trigger cannot be activated or null if it can be activated.
-