AFK Display
Free open-source datapack for Minecraft version 1.21 and above that displays "away from keyboard" status next to each player's nickname.
Main Features
When a player remains motionless for a period between 2 minutes 30 seconds and 5 minutes, they are automatically added to the special AFK team. Membership in this team adds the [AFK] tag after the player's name.
This status automatically appears next to every nickname in various game interfaces: player lists, side panels, and also in chat if the player sends a message while in AFK mode.
As soon as the player starts moving again, they are automatically removed from the AFK team, and the [AFK] tag disappears from their nickname.
There is also a manual command /trigger afk available for forced display of AFK status to other players.
Datapack Removal
To completely remove the datapack from the world, execute the command: /function afk_display:uninstall