Coder Social home page Coder Social logo

prismarine-entity's Introduction

prismarine-entity

NPM version Build Status

Represent a minecraft entity with an api.

Usage

let prismarineEntity = require("prismarine-entity")

let Entity = new prismarineEntity(0)

console.log(Entity)

API

Entity(entityId, readMetadata = defaults false)

Entities represent players, mobs, and objects.

entity.id

Unique 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

Vec3 presentation of entity's location.

entity.velocity

Vec3 presentation of entity's velocity.

entity.yaw

Entity's yaw.

entity.pitch

Entity's pitch.

entity.height

entity.width

entity.onGround

True when entity is on ground.

entity.equipment[5]

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

entity.heldItem

Equivalent to entity.equipment[0].

entity.metadata

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

entity.health

The health of the player, default: 20.

entity.food

The food of the player, default: 20.

entity.player

If entity is not player, here will undefined.

Below this events, needs to metadata reading enabled.

entity.isOnFire => Defaults false, when entity is on fire it will true.

entity.isCrouched => Defaults false, when entity is crouched it will true.

entity.isSprinting => Defaults false, when entity is sprinted it will true.

entity.isInvisible => Defaults false, when entity is invisible it will true.

entity.isMovingSlowly => Defaults false, when entity is Eating/Drinking/Blocking it will true.

entity.isSwimming => Only for 1.9+, Defaults false, when entity is swimming it will true.

entity.isGlowing => Only for 1.9+, Defaults false, when entity is glowing it will true.

entity.isFlyingElytra => Only for 1.9+, Defaults false, when entity is flying it will true.

prismarine-entity's People

Contributors

dependabot-preview[bot] avatar idanho avatar kaffinpx avatar karang avatar mat-1 avatar rom1504 avatar thedudefromci avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.