This version changes how the away/back logic works to remove the need for a permanently-running loop. The loop only runs while there are players tagged as afk
. The data pack is now much lazier!
- Added a loop to remove offline players from the
afk
team, fixing players that left while AFK re-joining and showing theafk
team color and prefix/suffix in chat.
This update is a small but significant change: when players are already in a team, it will not put them in the afk
team. When players are not in the afk
team when returning, they will not be removed from their team.
The behavior <1.1 would naively override the team, and then leave whatever team the player was in regardless of if it had changed when the player returned.
I believe this new behavior is an improvement, but if it causes issues for you, please open an issue on GitHub and I'll look into it ASAP. However, this should be a more reliable system over all.
Tested on 1.18 and 1.21
Updated to include support for 1.21.0
Version 1 of this extremely simple datapack. Unless Mojand makes a drastic change to the team
command, I don't imagine there will need to be any updates (except for bumping the maximum compatible pack version)