Interface InteractionListener

All Superinterfaces:
Consumer<InteractionEvent>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface InteractionListener extends Consumer<InteractionEvent>
The InteractionListener interface, implementing this interface creates a standard representation of the behaviour when an InteractionEvent is published in the EventBus
Examples:
     
     class MyScript extends Script implements InteractionListener {
         //Script functions

         @Override
         public void onInteraction(InteractionEvent event) {
             //Handle interaction event.
             System.out.println(event);
         }

         @Override
         public void initialize() {
             super.initialize();
             super.subscribe(InteractionEvent.class, this);
         }
     }
     
 
See Also: