Represent a minecraft block with its associated data
const Block=require("prismarine-block")("1.8");
const stoneBlock=new Block(1,1,0);
console.log(stoneBlock);
// can you harvest stone with an iron pickaxe ?
console.log(stoneBlock.canHarvest(257));
// how many milliseconds does it takes in usual conditions ? (on ground, not in water and not in creative mode)
console.log(stoneBlock.digTime(257));
Constructor of a block
type
is the block numerical idbiomeId
is the biome numerical idmetadata
is the metadata numerical value
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)
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 creativeinWater
the bot is in waternotOnGround
the bot is not on the ground
Vec3 instance.
Numerical id.
Number which represents different things depending on the block. See http://www.minecraftwiki.net/wiki/Data_values#Data
A biome instance. See Biome.
If the block is a sign, contains the sign text.
If the block is a painting, contains information about the painting.
id
position
name
direction
- direction vector telling how the painting is facing.
Boolean, whether the block is considered diggable.
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.
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.
The set of tools that will allow you to harvest the block.
The blocks or items dropped by that block.
- use the minStateId if passing the blockType
- add block state id feature (for >= 1.13)
- bump mcdata
- bump dependencies
- Import from mineflayer