AFK Dim Names
An add-on for Detect AFK Players.
Dims player names when they go AFK. This works by adding them to a team called afk. If players are on a team already when they go AFK, they will not be added to the AFK team.
The afk team can be modified. An example is to add the "AFK" prefix or suffix to player names:
/team modify afk prefix "AFK "
By default, only the name color is changed. This is to give you the freedom to decide what you do and don't need!

To disable collision with AFK players:
/team modify afk collisionRule never
This datapack is stupidly simple and is a good place to start if you want to see a reference for how to integrate with Detect AFK Players. The code is MIT licensed and open source, so feel free to modify it as you want.
All Versions
+ Add Versionafk. The data pack is now much lazier!afk. The data pack is now much lazier!- Added a loop to remove offline players from the
afkteam, fixing players that left while AFK re-joining and showing theafkteam color and prefix/suffix in chat.
- Added a loop to remove offline players from the
afkteam, fixing players that left while AFK re-joining and showing theafkteam color and prefix/suffix in chat.
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](https://github.com/clo4/datapacks/issues) and I'll look into it ASAP. However, this should be a more reliable system over all.
Tested on 1.18 and 1.21
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](https://github.com/clo4/datapacks/issues) and I'll look into it ASAP. However, this should be a more reliable system over all.
Tested on 1.18 and 1.21
team command, I don't imagine there will need to be any updates (except for bumping the maximum compatible pack version)