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-totem

v0.1.2

Published

Auto totem for mineflayer

Readme

Mineflayer Auto Totem

A Mineflayer plugin that automatically equips a Totem of Undying to the off-hand when the bot's health drops below a threshold.

GitHub Repository: https://github.com/FourTerms2/mineflayer-totem

Features

  • Automatically equips totem when health drops below 10 HP
  • Monitors health continuously (checks every 100ms)
  • Searches entire inventory for totems
  • Equips to off-hand slot for proper totem functionality
  • Lightweight and efficient

💬 Discord Community

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

Installation

npm install mineflayer-totem

Usage

const mineflayer = require('mineflayer');
const { AutoTotem } = require('mineflayer-totem');

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

// Initialize and start the totem module
const autoTotem = new AutoTotem(bot);
autoTotem.start();

Configuration

Default Settings

  • Health Threshold: 10 HP (5 hearts)
  • Check Interval: 100ms
  • Target Slot: Off-hand (slot 45)

Customizing Health Threshold

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

How It Works

  1. The module listens to the bot's health events
  2. Every 100ms, it checks if health is below the threshold
  3. When health drops below threshold, it searches for a totem in inventory
  4. If found, it equips the totem to the off-hand slot
  5. The totem will activate automatically if the bot takes fatal damage

API

new AutoTotem(bot)

Creates a new AutoTotem instance.

Parameters:

  • bot - The Mineflayer bot instance

Properties:

  • lowHealthThreshold - Health level that triggers totem equipping (default: 10)
  • offhandSlot - Inventory slot for off-hand (default: 45)

Methods:

  • start() - Begins monitoring health and auto-equipping totems
  • handleAutoTotem() - Checks health and triggers totem equipping if needed
  • equipTotem() - Equips a totem to the off-hand
  • findTotemInInventory() - Searches for a totem in the bot's inventory

Notes

  • The bot needs to have a Totem of Undying in its inventory for this to work
  • Totems are consumed when they save the bot from death
  • Make sure your bot has a way to obtain more totems (trading, looting, etc.)

License

MIT