EssentialsX

EssentialsX

2M Downloads

Improve the AfkStatusChangeEvent

Andre601 opened this issue ยท 0 comments

commented

Feature request

Feature description
I think an improvement of the AfkStatusChangeEvent to provide additional information would be useful.
Right now does the Event only provide if the player went AFK or came back from it (That's what getValue() returns as boolean right?) and the affected user.

From what I found out does it also fire when a player is AFK and then disconnects, which could cause issues if a plugin listens for both this event and the Disconnect event of a server, as those would fire two separate events that may cause unwanted actions to be triggered.

My idea now is to add additional information for the event, like what exactly caused it (command, auto and disconnect to mention some options),

How the feature is useful
Adding this would allow us to perform actions more precisely and only execute them when the type matches.
For example: When someone would have a sign plugin that displays the current state of a player on the sign, and essentials' AFK status is supported, then this would prevent a possible issue, where the sign quickly switches between "online" (caused by Essentials' afk event being fired) and "offline" when the player was AFK and disconnected.