Connecting to a Minecraft server over IRC

For server administration, or just chatting with friends

2020-11-21 minecraft project irc

As I talked about in my post about Minecraft modpack development, I got back in to playing Minecraft earlier this year. I primairly play on a server full of friends, where the server owner has dynmap installed. Dynmap is a handy tool that provides a near-real-time overview of the minecraft world in the form of a webapp. I always keep Dynmap open on my laptop so I can chat with whoever is online, and see whats being worked on.

While dynmap has a built-in chat log, and the ability to send chats, the incoming chat messages do not persist, and the outgoing chat messages don’t always show your in-game username (but instead, your public IP address). Since I always have an IRC client open, I figured that making use of my IRC client to generate a persistent chat log in the background would be a good solution. Unfortunately, I could not find anyone who has ever built a Minecraft <-> IRC bridge. Thus my project, chatster, was born.

The most basic IRC server consists of a TCP socket, and only 7 message handlers:

Message Type Description
NICK Handles a user setting their nickname
USER Handles a user setting their identity / username
PASS Handles a user authenticating with the server
PING A simple ping-pong system
JOIN Handles a user joining a channel
QUIT Handles a user leaving a channel
PRIVMSG Handles a user sending a message

On the Minecraft side, the following subset of the in-game protocol must be implemented (I just used the pyCraft library for this):

The whole idea of chatster is that a user connects to the IRC server using their Mojang account email and password at their IRC nickname, and server password. The server temporarily stores these values in memory.

Connecting to a server is done via specific IRC channel names. If you wanted to connect to on port 12345, you would issue the following IRC command:


Upon channel join, the server opens a socket to the specified Minecraft server, and relays chat messages (along with their sender) to both Minecraft and IRC. This means that ingame users show up in your IRC user list, and you can send commands and chats to the game.

Thank you for reading this post. If you enjoyed the content, and want to let me know, or want to ask any questions, please contact me via one of the methods listed here. If you would like to be notified about future posts, feel free to load my rss feed into your favorite feed reader, or follow me on Twitter for notifications about my work and future posts.

If you have the time to read some more, I recommend checking out one of the following posts:

Tunneling a printer from a home network to a VPN
I use a self-hosted VPN to access all my devices at all times, and to deal with my school's aggressive firewall. This post explains the process I use for exposing my home printer to the VPN.
2020 Wrap-Up
2020 has been my most productive year so far in terms of software development. This post looks back at the year
How I have tweaked my Minecraft client to be 'just right'
Over the past 10 years, I have been building the perfect Minecraft experience for myself. This post shares the collection of mods I run, and why I use them.

Made with ♥ by Evan Pratten | RSS | API Status