EssentialsX

EssentialsX

2M Downloads

Afk message is sent despite AfkStatusChangeEvent being cancelled

xtomyserrax opened this issue ยท 1 comments

commented

I noticed that after cancelling the event (with ACTIVITY cause), the you are AFK message is being sent depiste me being not AFK.

image

A good way to fix this could be by making setAfk method to return a boolean instead of void, so if it returns true it means that it could set the player, if its false, its because the event was cancelled. (

public void setAfk(boolean set, AfkStatusChangeEvent.Cause cause) {
)

So for example, you could check here what it returns and depending on that to send the message:

setAfk(true, AfkStatusChangeEvent.Cause.ACTIVITY);

(Im using latest released Essentials version 2.18.0.0)

Wish I was clear! Thank you!

commented

These is currently a PR open for this issue already at #3402.