npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mineflayer-utility-bot

v0.1.2

Published

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

Readme

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