Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

mineflayer-utility-bot

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mineflayer-utility-bot

A utility package for Mineflayer bots, including automatic eating and totem handling.

latest
npmnpm
Version
0.1.2
Version published
Weekly downloads
36
28.57%
Maintainers
1
Weekly downloads
 
Created
Source

Mineflayer Utility Bot

A comprehensive Mineflayer utility package that combines automatic eating, totem management, and death tracking into a single module.

GitHub Repository: https://github.com/FourTerms2/mineflayer-utility-bot

💬 Discord Community

Join our Discord server for support, updates, and community discussions. For faster support, please make a ticket: https://discord.gg/RMC3PcKrpt

Features

Auto Eat

  • Automatically eats food when hunger drops below 20
  • Configurable food list with sensible defaults
  • Checks inventory every 2 seconds

Auto Totem

  • Automatically equips Totem of Undying when health drops below 10 HP
  • Continuous health monitoring (100ms intervals)
  • Searches entire inventory for totems

Death Tracking

  • Logs all bot deaths with timestamps
  • Records death location (X, Y, Z coordinates)
  • Identifies killer (player, mob, or environmental)
  • Logs weapon used by player killers
  • Saves death log to death.txt file

Installation

npm install mineflayer-utility-bot

Usage

Basic Setup

const mineflayer = require('mineflayer');
const { Food, AutoTotem, BotDeath } = require('mineflayer-utility-bot');

const bot = mineflayer.createBot({
  host: 'localhost',
  username: 'bot'
});

// Initialize all utilities
const food = new Food(bot);
const autoTotem = new AutoTotem(bot);
autoTotem.start();
const deathTracker = new BotDeath(bot);

Using Individual Modules

You can use only the modules you need:

// Only auto-eating
const { Food } = require('mineflayer-utility-bot');
const food = new Food(bot);

// Only totem management
const { AutoTotem } = require('mineflayer-utility-bot');
const autoTotem = new AutoTotem(bot);
autoTotem.start();

// Only death tracking
const { BotDeath } = require('mineflayer-utility-bot');
const deathTracker = new BotDeath(bot);

API Reference

Food Class

Constructor: new Food(bot)

Properties:

  • foodList - Array of food items the bot will eat

Default Food List:

  • minecraft:cooked_beef
  • minecraft:cooked_chicken
  • minecraft:bread

Methods:

  • normalizeFoodName(foodName) - Adds minecraft: prefix if missing
  • startAutoEat() - Begins automatic eating loop
  • tryToEat() - Attempts to eat food from inventory
  • findFoodInInventory() - Searches for consumable food

AutoTotem Class

Constructor: new AutoTotem(bot)

Properties:

  • lowHealthThreshold - Health level that triggers totem equipping (default: 10)
  • offhandSlot - Off-hand inventory slot (default: 45)

Methods:

  • start() - Begins health monitoring and auto-equipping
  • handleAutoTotem() - Checks health and triggers totem equipping
  • equipTotem() - Equips totem to off-hand
  • findTotemInInventory() - Searches for totem in inventory

BotDeath Class

Constructor: new BotDeath(bot)

Methods:

  • getKillerWeapon(killer) - Gets the weapon used by a killer
  • setupDeathHandler() - Sets up death event listener

Death Log Format:

[MM/DD/YYYY, HH:MM:SS AM/PM] The bot has died at [timestamp] at location: X: 100, Y: 64, Z: -200. Killed by player: Steve using diamond_sword.

Configuration Examples

Custom Food List

const food = new Food(bot);
food.foodList = [
  'minecraft:golden_apple',
  'minecraft:cooked_porkchop',
  'minecraft:steak'
];

Custom Health Threshold

const autoTotem = new AutoTotem(bot);
autoTotem.lowHealthThreshold = 14; // Equip at 7 hearts
autoTotem.start();

Output Files

  • death.txt - Contains timestamped death logs with location and killer information

Requirements

  • Node.js
  • Mineflayer

License

MIT

Keywords

mineflayer

FAQs

Package last updated on 16 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts