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 🙏

© 2024 – Pkg Stats / Ryan Hefner

prismarine-entity

v2.4.0

Published

Represent a minecraft entity

Downloads

28,348

Readme

prismarine-entity

NPM version Build Status

Represent a minecraft entity

Usage

const Entity = require("prismarine-entity")('1.8.9')

const entity = new Entity(0)
console.log(entity)

API

Entity

Entities represent players, mobs, and objects.

entity.id

entity.type

Choices:

  • player
  • mob
  • object
  • global - lightning
  • orb - experience orb.
  • other - introduced with a recent Minecraft update and not yet recognized or used by a third-party mod

entity.username

If the entity type is player, this field will be set.

entity.mobType

If the entity type is mob, this field will be set.

entity.displayName

Field set for mob and object. A long name in multiple words.

entity.entityType

Field set for mob and object. The numerical type of the entity (1,2,...)

entity.kind

Field set for mob and object. The kind of entity (for example Hostile mobs, Passive mobs, NPCs).

entity.name

Field set for mob and object. A short name for the entity.

entity.objectType

If the entity type is object, this field will be set.

entity.count

If the entity type is orb, this field will be how much experience you get from collecting the orb.

entity.position

entity.velocity

entity.yaw

entity.pitch

entity.height

entity.width

entity.onGround

entity.equipment[5]

Version dependent.

1.8 Layout:

  • 0 - held item
  • 1 - shoes
  • 2 - legging
  • 3 - torso
  • 4 - head

1.9 and later:

  • 0 - held item
  • 1 - off-hand
  • 2 - shoes
  • 3 - legging
  • 4 - torso
  • 5 - head

entity.heldItem

Equivalent to entity.equipment[0].

entity.metadata

See http://wiki.vg/Entities#Entity_Metadata_Format for more details.

entity.noClip

entity.vehicle

Entity that this entity is riding on

entity.passenger

Entity that is riding on this entity

entity.health

The health of the player, default: 20

entity.food

The food of the player, default: 20

entity.elytraFlying

Whether or not the entity is elytra flying.

entity.player

The player

entity.getCustomName()

returns a prismarine-chat ChatMessage object for the name of the entity or null if there isn't one

entity.getDroppedItem()

returns a prismarine-item Item object for the dropped item, if this is a dropped item, or it will return null

History

2.4.0

2.3.1

2.3.0

2.2.0

  • mcData to registry refactoring (step towards #2450)

2.1.1

  • Update mcdata

2.1.0

  • Adds Entity#getDroppedItem

2.0.0

  • require mcversion in constructor
  • add Entity#getCustomName()
  • Add attributes for entity entity collision calculation (thanks @O-of)

1.2.0

  • Add food saturation to typings
  • Add id to typings
  • Add effects to typings

1.1.0

  • Added entity width property

1.0.0

  • typescript definitions (thanks @IdanHo)

0.2.0

  • extend EventEmitter

0.1.0

  • Import from mineflayer