UNPKG

@jsprismarine/prismarine

Version:

Dedicated Minecraft Bedrock Edition server written in TypeScript

115 lines 3.04 kB
import { default as Server } from '../Server'; import { Item } from '../item/Item'; import { ItemTieredToolType } from '../item/ItemTieredToolType'; import { BlockToolType } from './BlockToolType'; export declare class Block { /** * The block's numeric block ID. */ id: number; /** * The block's namespaced block ID. */ name: string; /** * The block's java-edition namespaced block ID. */ javaName: string; hardness: number; meta: number; private networkId; nbt: null; count: number; constructor({ id, name, javaName, parentName, hardness }: { id: number; name: string; javaName?: string; parentName?: string; hardness?: number; }); get [Symbol.toStringTag](): string; toString(): string; /** * Get the Block's namespaced id. */ getName(): string; /** * Get the Block's meta value. */ getMeta(): number; /** * Get the Block's numeric id. * * @returns The block's numeric ID. */ getId(): number; /** * Get the Block's network numeric id. */ getNetworkId(): number; /** * Get the Block's hardness value. */ getHardness(): number; /** * Get the Block's break time. */ getBreakTime(_item: Item | null, _server: Server): number; /** * Get the Block's blast resistance. */ getBlastResistance(): number; /** * Get the Block's light level emission. */ getLightLevel(): number; /** * Get the Block's flammability. */ getFlammability(): number; /** * Get the Block's required tool type. */ getToolType(): BlockToolType[]; /** * Get the Block's required item tool tier. */ getToolHarvestLevel(): ItemTieredToolType; /** * Get the Block's drop(s) if the tool is compatible. */ getDropsForCompatibleTool(_item: Item | null, _server: Server): Array<Block | Item | null>; /** * Get the Block's drop(s) from the current item. */ getDrops(item: Item | null, server: Server): Array<Block | Item | null>; /** * Get the Block's drop(s) if silk touch is used. */ getSilkTouchDrops(_item: Item, _server: Server): this[]; getLightFilter(): number; canPassThrough(): boolean; /** * Sets if the block can be replaced when place action occurs on it. */ canBeReplaced(): boolean; canBePlaced(): boolean; canBeFlowedInto(): boolean; isTransparent(): boolean; /** * Check if the block is breakable. * * @returns `true` if the block is breakable otherwise `false`. */ isBreakable(): boolean; /** * Check if the block is solid. * * @returns `true` if the block is solid otherwise `false`. */ isSolid(): boolean; isCompatibleWithTool(item: Item | null): boolean; isAffectedBySilkTouch(): boolean; isPartOfCreativeInventory(): boolean; } //# sourceMappingURL=Block.d.ts.map