
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
mineflayer-cmd
Advanced tools
A simple command manager and handler for Mineflayer plugins.
This plugin is built using Node and can be installed using:
npm install --save mineflayer-cmd
Loading the plugin can be done the same as any other plugin. Commands can also be loaded at any time.
// Create your bot
const mineflayer = require("mineflayer");
const bot = mineflayer.createBot({ username: "Player" });
// Load the cmd plugin
const cmd = require('mineflayer-cmd').plugin
cmd.allowConsoleInput = true // Optional config argument
bot.loadPlugin(cmd)
// Register your custom command handlers, if desired (plugins can load them too)
function sayCommand(sender, flags, args, cb) {
let message = ''
if (flags.showsender) message += sender + ": "
if (flags.color) message += '&' + flags.color[0]
message += args.join(' ')
bot.chat(message)
cb()
}
bot.once('cmd_ready', () => {
bot.cmd.registerCommand('say', sayCommand, // Create a new command called 'say' and set the executor function
'make me say something', // help text
'say <message>') // usage text
// Add a flag called 'color' that expects 1 input
.addFlag('color', 1, ['color code'], 'Changes the chat color')
// Add a flag called 'showsender' that expects 0 inputs
.addFlag('showsender', 0, [], 'If present, displays the sender who sent this message')
})
// And listen for command inputs from any source
// Let's listen for chat events that start with "!"
bot.on('chat', (username, message) => {
if (message.startsWith('!')) {
const command = message.substring(1)
bot.cmd.run(username, command) // Run with the sender and the command itself
}
})
This project uses the MIT license.
This project is accepting PRs and Issues. See something you think can be improved? Go for it! Any and all help is highly appreciated!
For larger changes, it is recommended to discuss these changes in the issues tab before writing any code. It's also preferred to make many smaller PRs than one large one, where applicable.
FAQs
A simple command handler plugin for Mineflayer.
The npm package mineflayer-cmd receives a total of 23 weekly downloads. As such, mineflayer-cmd popularity was classified as not popular.
We found that mineflayer-cmd demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.