Socket
Book a DemoInstallSign in
Socket

mineflayer-death-event

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mineflayer-death-event

Emit player death event in Mineflayer.

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
28
211.11%
Maintainers
1
Weekly downloads
 
Created
Source

mineflayer-death-event

Emit player death event in Mineflayer.

GitHub stars GitHub license Rate on Openbase

NPM

简体中文 文档

Install

npm install mineflayer-death-event --save

or

yarn add mineflayer-death-event

Example

const mineflayer = require("mineflayer")
const autoeat = require("mineflayer-death-event")

const bot = mineflayer.createBot({
  host: "mc.example.com",
  username: "testbot"
})

// Load the plugin
bot.loadPlugin(autoeat)

bot.on("playerDeath", (data) => {
    console.log(data);
});

Example Code

Event

mineflayer-death-event will emit a event when player die. The event name is playerDeath.

victim

Attacker. Interface see Entity.

offender

The player being attacked. Interface see Entity.

module will export two constants. You can Determine the type of variable "type"

const { DEATH_ENTITY_TYPE_MOB, DEATH_ENTITY_TYPE_PLAYER } = require("mineflayer-death-event");

weapon

The weapon used to kill the attacked player. Interface see Weapon.

method

offender death method.

Interface

Entity

propertytypedescription
typeStringIs player or mob/entity
idStringPlayer UUID
detailFunctionIf type not is "mob", then will return Mineflayer player interface (source)
rawFunctionOriginal value, from message event

Weapon

propertytypedescription
assetIdStringWeapon's Minecraft asset ID
tagStringWeapon's tag
mameStringWeapon's mame, This is usually named after the anvil
rawFunctionOriginal value, from message event
tagToJSONFunctionParse and simplify weapon tag

Keywords

mineflayer

FAQs

Package last updated on 21 Nov 2021

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.