Skip to content

API reference / @jsprismarine/prismarine / block/Block

block/Block ​

Classes ​

Interfaces ​

BlockDropServer ​

Defined in: packages/prismarine/src/block/Block.ts:374

What Block.getDrops reads off the server: its content.

Methods ​

getContent()? ​

optional getContent(): ServerContent | undefined

Defined in: packages/prismarine/src/block/Block.ts:375

Returns ​

ServerContent | undefined


BlockFacts ​

Defined in: packages/prismarine/src/block/Block.ts:24

Everything the server reads off one block state.

Resolved once, by whoever built the block, rather than looked up per call. blockFromContent fills it from ServerContent's flattened per-state table when the server built its content from packs; a block built without one falls back to @jsprismarine/mapping's Java-sourced table, which is the same data the overlay pack is generated from.

Properties ​

blastResistance ​

readonly blastResistance: number

Defined in: packages/prismarine/src/block/Block.ts:28

Java explosion resistance; obsidian is 1200 where its hardness alone would say 250.

burnOdds ​

readonly burnOdds: number

Defined in: packages/prismarine/src/block/Block.ts:36

Fire's odds of consuming the block once lit, Java's burn odds.

friction ​

readonly friction: number

Defined in: packages/prismarine/src/block/Block.ts:34

Ground friction: 0.6 for almost everything, 0.989 for blue ice.

hardness ​

readonly hardness: number

Defined in: packages/prismarine/src/block/Block.ts:26

Java destroy time in seconds; -1 marks the unbreakable.

lightEmission ​

readonly lightEmission: number

Defined in: packages/prismarine/src/block/Block.ts:30

Emitted light, 0 to 15.

lightFilter ​

readonly lightFilter: number

Defined in: packages/prismarine/src/block/Block.ts:32

How much light the block swallows, 0 to 15.

requiresCorrectTool ​

readonly requiresCorrectTool: boolean

Defined in: packages/prismarine/src/block/Block.ts:38

Whether breaking without the right tool yields nothing.

solid ​

readonly solid: boolean

Defined in: packages/prismarine/src/block/Block.ts:40

Whether anything can stand on the block.


BlockProps ​

Defined in: packages/prismarine/src/block/Block.ts:44

What a Block is built from.

Properties ​

content? ​

optional content?: ServerContent

Defined in: packages/prismarine/src/block/Block.ts:60

The content the block's drops are rolled against, when the server built one.

facts? ​

optional facts?: BlockFacts

Defined in: packages/prismarine/src/block/Block.ts:58

The resolved facts, when the caller read them out of a content build.

name ​

name: string

Defined in: packages/prismarine/src/block/Block.ts:46

The namespaced Bedrock block identifier, such as minecraft:oak_stairs.

stateName? ​

optional stateName?: string

Defined in: packages/prismarine/src/block/Block.ts:56

The vanilla block state this block is placed as, when that differs from name.

Bedrock does not always have one block per thing the server models: all sixteen colored beds are minecraft:bed on the wire, with the color in the block entity.

states? ​

optional states?: Readonly<Record<string, BlockStateValue>>

Defined in: packages/prismarine/src/block/Block.ts:48

The state values the block carries, empty for its default state.

Functions ​

blockFromContent() ​

blockFromContent(name, content, states?): Block | null

Defined in: packages/prismarine/src/block/Block.ts:344

Resolves a block from loaded content, falling back to the shipped schema when no type was loaded.

Parameters ​

name ​

string

content ​

ServerContent | undefined

states? ​

Readonly<Record<string, BlockStateValue>> = {}

Returns ​

Block | null


javaBlockFactsOf() ​

javaBlockFactsOf(name, states?): BlockFacts

Defined in: packages/prismarine/src/block/Block.ts:85

The Java-sourced facts of one block state.

Solidity is not in that table, because no Mojang report publishes a per-block collision column, so it comes from @jsprismarine/engine-systems's own rule - the same one the fluid, piston and spawn code already uses.

Parameters ​

name ​

string

states? ​

Readonly<Record<string, BlockStateValue>> = {}

Returns ​

BlockFacts