diff --git a/src/content/docs/velocity/dev/api/event.md b/src/content/docs/velocity/dev/api/event.md index e19092fea..375100615 100644 --- a/src/content/docs/velocity/dev/api/event.md +++ b/src/content/docs/velocity/dev/api/event.md @@ -126,7 +126,17 @@ or add a second return an [`Continuation`](jd:velocity:com.velocitypowered.api.e ```java @Subscribe(priority = 100) public void onLogin(LoginEvent event, Continuation continuation) { - doSomeAsyncProcessing().addListener(continuation::resume, continuation::resumeWithException); + doSomeAsyncProcessing().whenComplete((_, throwable) -> { + if (throwable != null) { + continuation.resumeWithException(throwable); + } else { + continuation.resume(); + } + }); + } + + private CompletableFuture doSomeAsyncProcessing() { + //... } @Subscribe(priority = 100)