mineflayer-pvp
TypeScript icon, indicating that this package has built-in type declarations

1.3.2 • Public • Published

mineflayer-pvp

A lightweight plugin for Mineflayer that makes it easier to manage PVP and PVE actions.


Getting Started

This plugin is built using Node and can be installed using:

npm install --save mineflayer-pvp

Plugin Dependencies These plugins must be loaded using bot.loadPlugin in order to use this plugin.

Simple Bot

The brief description goes here.

const mineflayer = require('mineflayer')
const { pathfinder, Movements, goals } = require('mineflayer-pathfinder')
const pvp = require('mineflayer-pvp').plugin

const bot = mineflayer.createBot({ 'Guard' })

bot.loadPlugin(pathfinder)
bot.loadPlugin(pvp)

bot.on('chat', (username, message) => {
  if (message === 'fight me') {
    const player = bot.players[username]

    if (!player) {
      bot.chat("I can't see you.")
      return
    }

    bot.pvp.attack(player.entity)
  }

  if (message === 'stop') {
    bot.pvp.stop()
  }
})

Documentation

API

Examples

Video Tutorial:

License

This project uses the MIT license.

Contributions

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.

Package Sidebar

Install

npm i mineflayer-pvp

Weekly Downloads

298

Version

1.3.2

License

MIT

Unpacked Size

22.9 kB

Total Files

13

Last publish

Collaborators

  • thedudefromci