Skip to content

Commit

Permalink
use prismarine-entity, and remove doc that is now in prismarine-* mod…
Browse files Browse the repository at this point in the history
…ules
  • Loading branch information
rom1504 committed Aug 30, 2015
1 parent ca365c3 commit 3bd31f5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 220 deletions.
220 changes: 3 additions & 217 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,51 +16,8 @@
- [mineflayer.vec3](#mineflayervec3)
- [mineflayer.Location](#mineflayerlocation)
- [mineflayer.Entity](#mineflayerentity)
- [entity.id](#entityid)
- [entity.type](#entitytype)
- [entity.username](#entityusername)
- [entity.mobType](#entitymobtype)
- [entity.displayName](#entitydisplayname)
- [entity.entityType](#entityentitytype)
- [entity.kind](#entitykind)
- [entity.name](#entityname)
- [entity.objectType](#entityobjecttype)
- [entity.count](#entitycount)
- [entity.position](#entityposition)
- [entity.velocity](#entityvelocity)
- [entity.yaw](#entityyaw)
- [entity.pitch](#entitypitch)
- [entity.height](#entityheight)
- [entity.onGround](#entityonground)
- [entity.equipment[5]](#entityequipment5)
- [entity.heldItem](#entityhelditem)
- [entity.metadata](#entitymetadata)
- [mineflayer.Block](#mineflayerblock)
- [block.canHarvest(heldItemType)](#blockcanharvesthelditemtype)
- [block.staticDigTime(heldItemType,creative,inWater,notOnGround)](#blockstaticdigtimehelditemtypecreativeinwaternotonground)
- [block.position](#blockposition)
- [block.type](#blocktype)
- [block.name](#blockname)
- [block.displayName](#blockdisplayname)
- [block.metadata](#blockmetadata)
- [block.light](#blocklight)
- [block.skyLight](#blockskylight)
- [block.hardness](#blockhardness)
- [block.biome](#blockbiome)
- [block.signText](#blocksigntext)
- [block.painting](#blockpainting)
- [block.diggable](#blockdiggable)
- [block.boundingBox](#blockboundingbox)
- [block.material](#blockmaterial)
- [block.harvestTools](#blockharvesttools)
- [block.drops](#blockdrops)
- [mineflayer.Biome](#mineflayerbiome)
- [biome.id](#biomeid)
- [biome.color](#biomecolor)
- [biome.height](#biomeheight)
- [biome.name](#biomename)
- [biome.rainfall](#biomerainfall)
- [biome.temperature](#biometemperature)
- [mineflayer.Item](#mineflayeritem)
- [item.type](#itemtype)
- [item.count](#itemcount)
Expand Down Expand Up @@ -349,186 +306,15 @@ properties.

Entities represent players, mobs, and objects. They are emitted
in many events, and you can access your own entity with `bot.entity`.

#### entity.id

#### entity.type

Choices:

* `player`
* `mob`
* `object`
* `global` - lightning
* `orb` - experience orb.
* `other` - introduced with a recent Minecraft update and not yet recognized by Mineflayer 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.onGround

#### entity.equipment[5]

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

Each is a `mineflayer.Item`.

#### entity.heldItem

Equivalent to `entity.equipment[0]`.

#### entity.metadata

See http://wiki.vg/Entities#Entity_Metadata_Format for more details.
See [prismarine-entity](https://github.com/PrismarineJS/prismarine-entity)

### mineflayer.Block

Uses [prismarine-block](https://github.com/PrismarineJS/prismarine-block)

#### block.canHarvest(heldItemType)

Tells you if `heldItemType` is one of the right tool to harvest the block.

* `heldItemType` the id of the held item (or null if nothing is held)

#### block.staticDigTime(heldItemType,creative,inWater,notOnGround)

Tells you how long it will take to dig the block, in milliseconds.

* `heldItemType` the id of the held item (or null if nothing is held)
* `creative` game in creative
* `inWater` the bot is in water
* `notOnGround` the bot is not on the ground

#### block.position

Vec3 instance.

#### block.type

Numerical id.

#### block.name

#### block.displayName

#### block.metadata

Number which represents different things depending on the block.
See http://www.minecraftwiki.net/wiki/Data_values#Data

#### block.light

#### block.skyLight

#### block.hardness

#### block.biome

A biome instance. See `Biome`.

#### block.signText

If the block is a sign, contains the sign text.

#### block.painting

If the block is a painting, contains information about the painting.

* `id`
* `position`
* `name`
* `direction` - direction vector telling how the painting is facing.

#### block.diggable

Boolean, whether the block is considered diggable.

#### block.boundingBox

The shape of the block according to the physics engine's collision decection. Currently one of:

* `block` - currently, partially solid blocks, such as half-slabs and ladders, are considered entirely solid.
* `empty` - such as flowers and lava.

#### block.material

This tells what types of tools will be effective against the block. Possible
values are: `null`, `rock`, `wood`, `plant`, `melon`, `leaves`, `dirt`, `web`, and `wool`.

See http://www.minecraftwiki.net/wiki/Digging and the `toolMultipliers`
variable at the top of lib/plugins/digging.js for more info.

#### block.harvestTools

The set of tools that will allow you to harvest the block.

#### block.drops

The blocks or items dropped by that block.
See [prismarine-block](https://github.com/PrismarineJS/prismarine-block)

### mineflayer.Biome

Uses [prismarine-biome](https://github.com/PrismarineJS/prismarine-biome)

#### biome.id

Numerical id.

#### biome.color

#### biome.height

#### biome.name

#### biome.rainfall

#### biome.temperature
See [prismarine-biome](https://github.com/PrismarineJS/prismarine-biome)

### mineflayer.Item

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
Block: require("prismarine-block")(mc.minecraftVersion),
Location: require('./lib/location'),
Biome: require("prismarine-biome")(mc.minecraftVersion),
Entity: require('./lib/entity'),
Entity: require('prismarine-entity'),
Painting: require('./lib/painting'),
Item: require('./lib/item'),
Recipe: require('./lib/recipe'),
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/entities.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var Vec3 = require('vec3').Vec3;
var _ = require('lodash');
var Entity = require('../entity');
var Entity = require('prismarine-entity');
var conv = require('../conversions');
var NAMED_ENTITY_HEIGHT = 1.62;
var CROUCH_HEIGHT = NAMED_ENTITY_HEIGHT - 0.08;
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"minecraft-data": "~0.5.0",
"node-mojangson": "~0.1.1",
"prismarine-biome":"0.1.0",
"prismarine-block":"0.1.0"
"prismarine-block":"0.1.0",
"prismarine-entity":"0.1.0"
},
"devDependencies": {
"mocha": "~2.2.1",
Expand Down

0 comments on commit 3bd31f5

Please sign in to comment.