Caution
Using Mineflayer and an Minecraft Account to log into Hypixel as a Bot violates Hypixels Terms of Service.
This may get your Minecraft Account banned if abused for non chat related things that give you an unfair advantage.
npm » npx jsr add @hypixelic/mineflayer
pnpm » pnpm dlx jsr add @hypixelic/mineflayer
bun » bunx jsr add @hypixelic/mineflayer
import mineflayer from "mineflayer";
import { HyFlayer, Bot as HyFlayerBot } from "@hypixelic/mineflayer"
// The following type trickery is needed as mineflayer isn't really type compatible.
// @ts-expect-error
const bot = mineflayer.createBot({
host: "hypixel.net",
username: "MICROSOFT_ACCOUNT_EMAIL",
auth: "microsoft",
version: "1.8.9",
}) as HyFlayerBot
const hyflayer = HyFlayer()
// @ts-expect-error
bot.loadPlugin(hyflayer);
bot.on("HYFLAYER_GUILD_CHAT", (event) => {
/*
On every Message sent in the Guild Chat you will now receive an Event Object structured like below:
{
"UUID":"14727faefbdc4aff848cd2713eb9939e",
"username":"Pixelic",
"message":"Hey",
"timestamp":1742216120
}
*/
});Commands are available through the bot.commands object:
bot.commands.inviteToParty("Pixelic");bot.commands.sendPrivateMessage(player, message)bot.commands.replyToPrivateMessage(message)bot.commands.sendPartyMessage(message)bot.commands.sendGuildMessage(message)bot.commands.sendGuildOfficerMessage(message)bot.commands.sendSkyblockCoopMessage(message)
bot.commands.addFriend(player)bot.commands.denyFriend()bot.commands.removeFriend(player)bot.commands.removeAllFriends()bot.commands.getFriends()
bot.commands.inviteToParty(player)bot.commands.removeFromParty(player)bot.commands.leaveParty()bot.commands.disbandParty()bot.commands.kickOfflinePartyMembers()bot.commands.warpParty()bot.commands.getPartyMembers()
bot.commands.sendGuildMessage(message)bot.commands.sendGuildOfficerMessage(message)bot.commands.toggleGuildSlowChat()bot.commands.muteGuildChat(duration)bot.commands.muteGuildMember(member, duration)bot.commands.unmuteGuildChat()bot.commands.unmuteGuildMember(member)bot.commands.getGuildInfo()bot.commands.getGuildMembers()bot.commands.getGuildMember(member)bot.commands.inviteToGuild(member)bot.commands.kickFromGuild(member)bot.commands.promoteGuildMember(member)bot.commands.demoteGuildMember(member)
bot.commands.addIgnore(player)bot.commands.removeIgnore(player)bot.commands.getIgnores()
bot.commands.boop(player)bot.commands.cookie(player)bot.commands.hug(player)
bot.commands.lobby(lobbyName)bot.commands.toggleChat()bot.commands.sendHypixelCommand(command, args)
lobbyName accepts Hypixel lobby IDs and aliases such as "bedwars", "skyblock", and "SkyBlock".
pnpm install: Installs all required dependenciespnpm build: Runs the TypeScript compilerpnpm test: Runs the local mocked command testspnpm test:live: Launches the Mineflayer Bot for live testing
Note
This Project is not affiliated or endorsed by Hypixel, Inc.