Добавляем репозиторий
repositories { mavenCentral() maven { url 'https://jitpack.io' } }
Создаем любой евент
import dev.onix.events.Cancellable; import dev.onix.events.Event; public class MyFirstEvent implements Event, Cancellable { private boolean cancel; @Override public boolean isCancelled() { return cancel; } @Override public void cancel() { cancel = true; } }
MyFirstEvent event = new MyFirstEvent(); EventManager.callEvent(event); if (event.isCancelled()) { System.out.println("Евент отменен"); }