Common code for Minecraft mods