EssentialsX

EssentialsX

2M Downloads

The AfkStatusChangeEvent is called first when False

AndRo-Marian opened this issue ยท 1 comments

commented
  1. When the A.F.K. status is turning off i cannot use the player.setPlayerListName("Player Name"); because the the PlayerName is changed after the event was triggered.
    Same with the essentials.getUser(player).isAFK() is updated after the event was triggered.
  • The AfkStatusChangeEvent should be triggered last after all changes.
commented

The event is called before changes are made so that plugins can cancel the event and thus prevent the player's AFK status changing.

To check whether the player will be AFK or not after the AFK status has changed, use AFKStatusChangeEvent#getValue. If you need to set the player's name on the player list, you can schedule a task to run on the next tick, by which point EssentialsX will be done handling its own changes.