This is a Forge 1.18.2 server-only mod that checks whether or not a user is AFK. If they are AFK for 5 minutes, it will send a message in chat. It will also send a message when they come back. In config/afkmod/playtime.txt, the mod will keep track of players' playtime by minute and their AFK time separately.
This mod does not have a configuration file, so you cannot change its features. Feel free to rebuild it if you need to make any changes.
I don't plan on frequently updating this mod or adding features because there are better mods in newer versions.
Don't ask about the tablist; it is impossible to make a user in the tablist show as AFK without this mod also on the client.