A while ago, I decided to write yet another server wrapper for Minecraft that would bridge chat messages between Minecraft and an IRC channel. The program can be found here. This has been done a decent number of times before. The primary reason I created yet another one was because I wanted an excuse to use Python's somewhat-new asyncio functionality. Unlike many of the existing implementations, this implementation works by wrapping stdin/stdout of the server process rather than by modifying the jar directly. It therefore needs minimal updating as Minecraft itself updates. It also does not implement most of the complexity needed to connect to "real" IRC networks. Instead, it is designed to connect via localhost to a bouncer program such as ZNC.
The wrapper program is configured using a single JSON file that is passed as a command line argument. An example config file (live on ##openfpga on Freenode right now) is below:
{
"cmdline": ["java", "-jar", "forge-1.7.10-10.13.4.1614-1.7.10-universal.jar", "-Xmx2G", "nogui"],
"irc_server": "2600:3c01:e000:1ab::1:1",
"irc_nick": "fpgacraft1",
"irc_port": 6667,
"irc_channel": "##openfpga",
"irc_password": "test",
"enable_irc_bridge": true,
"use_tellraw": true,
"backup_interval": 3600,
"num_backups": 5,
"enable_sig_verify": true,
"users": {
"rqou": "NyXS8NwA7NkpgHPlFhsh2X1lTXrdO/VQwx7a8HYf81U",
"rqou_": "NyXS8NwA7NkpgHPlFhsh2X1lTXrdO/VQwx7a8HYf81U"
}
}
Most of the fields should be reasonably self-explanatory. The only part of note
is how the IRC server authentication works. This authentication is done
unencrypted using the PASS
command. This is intended to connect only to a
local server over an internal loopback/bridge interface rather than the global
Internet. The server is a ZNC instance configured without any of the normal
logging or message replaying functionality but configured with the "reconnect"
and "keep nickname" functionality.
Lastly, commands to the bridge are supplied via special messages in the IRC channel. They are authenticated by checking both the IRC nickname and an Ed25519 signature. Read the source code for details.