Bridging Minecraft and Discord
I have a strong passion for programming and often spend my free time building tools that make tasks more efficient. My favorite project was developing a Hypixel Guild Bot, which connected Hypixel—the largest Minecraft server—with Discord.
The bot consisted of two main components: a Minecraft bot and a Discord bot. Together, they allowed guild members to communicate seamlessly across both platforms. Beyond messaging, I implemented systems to track player activity, manage guild applications, and support various administrative tasks. This project not only improved the guild’s organization but also deepened my experience with system integration and feature development.
Activity Tracking
One of the most impactful features I designed was the activity tracking system. Player activity in the guild was measured by two main factors: guild experience (XP) and playtime.
Guild XP was straightforward to track, as the Hypixel API provides daily XP values for each guild member. The bot automatically called the API once per day and updated the database with each player’s XP.
Playtime, however, required a creative solution since Hypixel does not provide it directly. To estimate playtime, the bot executed a command every five minutes to record which members were online. Each appearance incremented their daily playtime counter, giving guild admins a reliable approximation of player activity.
This data became the foundation for a promotion and demotion system. Players were evaluated weekly against activity milestones, with results integrated into a Discord interface that flagged members eligible for promotion or demotion. Admins could then review and take action quickly, making guild management more efficient and transparent.
Account Linking & Verification
At the core of the Discord system was the account linking feature, which connected a player’s Minecraft account to their Discord account. This ensured that guild admins always knew which Discord user corresponded to which in-game player, enabling deeper integration across the bot’s features—ranging from activity tracking and promotions to seasonal events and administrative tools.
The linking process leveraged a common Hypixel practice: players entered their Discord username into a designated in-game profile field, retrievable via the Hypixel API. The bot then verified ownership and matched the Minecraft account to the correct Discord user.
Importantly, verification was required before gaining access to the Discord server. This both guaranteed that every member was properly linked and acted as an effective safeguard against spammers and advertisers.
Application System
There were two main ways for players to apply to the guild:
- Hypixel Forums – Applicants submitted posts to the guild’s forum thread. Accepted players received a forum message instructing them to join the Discord server, where they could then receive their in-game guild invite.
- Discord Integration – Applicants could also apply directly through Discord. By clicking an application button, the bot automatically created a private channel where the player could fill out their application. Once reviewed, the same system was used to manage their guild invite.
A challenge with invites was that players needed to be online at the same time as a guild admin to join the guild. To solve this, I created a pending invite system. Admins could add players’ names to a queue, and when those players later joined the Discord, the bot automatically sent them a welcome message and a button they could press to instantly receive their in-game invite. This system streamlined recruitment, reduced delays, and made onboarding new members much more efficient.
The Technical Side
Now that I’ve highlighted my favorite features of the bot, I can explain how I built them. The bot was programmed in JavaScript, with Discord.js and Mineflayer as the two main packages.
Discord.js
On the Discord side, I implemented a file-based command system. Each command lived in its own file, containing variables (such as name, description, roles, and options) along with a runnable function. This modular approach made adding new commands simple and organized.
Discord Slash Commands also support subcommands, so I used subfolders to group related commands together. For example, the birthday command let users with the Birthday role change the role’s color on their birthday by entering a hex color code.
// Example Birthday Command (simplified)
const { MessageEmbed } = require("discord.js");
const cfg = require("../botconfig/botconfig.json");
module.exports = {
name: "birthday",
description: "Change the Birthday role color",
requiredroles: [cfg.roles.birthday],
options: [
{ "String": { name: "hexcode", description: "Insert a hex color code", required: true }},
],
run: async (client, interaction) => {
const hexCode = interaction.options.getString("hexcode");
let birthdayRole = interaction.guild.roles.cache.get(cfg.roles.birthday);
birthdayRole.edit({ color: hexCode })
.then(() => interaction.reply(`The Birthday role color has been changed to ${hexCode}`));
}
};
Commands are the backbone of the Discord side, but the Mineflayer integration is where the bot became truly interesting.
Mineflayer
Mineflayer’s job was to stay logged into Hypixel and interact with the in-game chat. It listened for events, parsed messages, and responded automatically. To keep this organized, I used a regex-based file system similar to the Discord commands: each regex handler lived in its own file, triggering specific actions.
For example, when a new member joined the guild, the bot:
- Detected the event using regex.
- Sent a welcome message in guild chat.
- Retrieved the player’s UUID from the Mojang API.
- Checked if the Minecraft account was linked to a Discord account.
- Updated the player’s Discord roles and sent a welcome message in the guild’s Discord server.
All of this happened automatically, without any admin needing to be online.
// Example Guild Join Handler (simplified)
module.exports = {
name: "guildJoin",
regex: /(?:\[.{0,20}\] )?(?<username>[A-Za-z0-9_]{0,17}) joined the guild!/,
description: "Handles new guild member joins.",
run: async (bot, username) => {
bot.chat(`/gc Welcome to the guild ${username}`);
// ... logic for UUID fetch, Discord sync, and role management
},
};
This seamless connection between Minecraft and Discord gave guild admins powerful tools for managing players, all while keeping the process automated and efficient.
Conclusion
Building this bot was one of the most rewarding projects I’ve worked on. It combined my passion for programming with real-world problem solving, turning everyday guild management into an automated and efficient system. By integrating Discord.js and Mineflayer, I was able to bridge two separate platforms—Minecraft and Discord—into a seamless experience for players and admins alike.
Beyond the technical challenges, this project taught me the importance of modularity, scalability, and creative problem-solving. Features like activity tracking, account verification, and application management pushed me to design systems that were not only functional but also maintainable and user-friendly.
Overall, the project reflects both my engineering mindset and my love of programming: taking a complex problem, breaking it down into manageable parts, and building a solution that has real impact on a community.