
ChatTimer
Write a complete Fabric mod in Java for Minecraft 1.21.10 with the following requirements: - Mod ID: "chat_timer", Group ID: "com.toby.chattimer", Version:...
00—fabricClient1.21.1mod
ChatTimer Mod Notes
- Adds a lightweight, client-only overlay that tracks how much time passes between the chat messages you send.
- Every time you send a normal chat message (not a command), an action bar message appears showing the elapsed time since your previous chat; the first message starts the timer.
- Feedback is local only: nothing extra is sent to the server or other players.
Implementation details:
- Listens to
ClientSendMessageEvents.CHATto detect outgoing chat. - Calculates elapsed time with
Instant/Durationand formats it as seconds with millisecond precision (minutes included when needed). - Uses the in-game HUD overlay message so the timer stays out of the main chat log.
Known limitations / future ideas:
- Timer resets when you restart the client or before the very first tracked message.
- Commands (
/...) are ignored; only plain chat messages are timed. - Overlay timing message can be replaced by other action bar messages from the game.