A block's type and states, as minecraft:oak_log with pillar_axis: "y".
Class in @minecraft/server
A block’s type and states, as minecraft:oak_log with pillar_axis: "y".
import { BlockPermutation } from '@minecraft/server';Properties
Section titled “Properties”read-only
readonly type: { readonly id: string };typeId
Section titled “typeId”read-only
readonly typeId: string;type.id.
localizationKey
Section titled “localizationKey”read-only
readonly localizationKey: string;The block type’s name key in the language files.
Methods
Section titled “Methods”resolve
Section titled “resolve”static
static resolve(blockName: string, states?: Record<string, boolean | number | string>): BlockPermutation;A permutation of a block; states left out take its defaults.
blockNamestringstatesoptionalRecord<string, boolean | number | string>
BlockPermutationgetState
Section titled “getState”getState(stateName: string): boolean | number | string | undefined;stateNamestring
boolean | number | string | undefinedgetAllStates
Section titled “getAllStates”getAllStates(): Record<string, boolean | number | string>;Record<string, boolean | number | string>withState
Section titled “withState”withState(name: string, value: boolean | number | string): BlockPermutation;A copy with one state changed.
namestringvalueboolean | number | string
BlockPermutationmatches
Section titled “matches”matches(blockName: string, states?: Record<string, boolean | number | string>): boolean;Whether it’s this block, with these states if given.
blockNamestringstatesoptionalRecord<string, boolean | number | string>
booleangetItemStack
Section titled “getItemStack”getItemStack(amount?: number): ItemStack | undefined;An item stack of the block.
amountoptionalnumber
ItemStack | undefinedgetTags
Section titled “getTags”getTags(): string[];The block type’s tags.
string[]hasTag
Section titled “hasTag”hasTag(tag: string): boolean;Whether it has this block tag.
tagstring
booleancanContainLiquid
Section titled “canContainLiquid”canContainLiquid(liquidType: LiquidType): boolean;Whether the block can hold this liquid.
liquidTypeLiquidType
booleancanBeDestroyedByLiquidSpread
Section titled “canBeDestroyedByLiquidSpread”canBeDestroyedByLiquidSpread(liquidType: LiquidType): boolean;Whether spreading liquid would break it.
liquidTypeLiquidType
booleanisLiquidBlocking
Section titled “isLiquidBlocking”isLiquidBlocking(liquidType: LiquidType): boolean;Whether it stops this liquid.
liquidTypeLiquidType
booleanliquidSpreadCausesSpawn
Section titled “liquidSpreadCausesSpawn”liquidSpreadCausesSpawn(liquidType: LiquidType): boolean;Whether liquid spreading onto it spawns the block’s drop.
liquidTypeLiquidType
booleanUsed by
Section titled “Used by”Block.permutation, Block.setPermutation, Dimension.setBlockPermutation, Dimension.fillBlocks, BlockExplodeAfterEvent.explodedBlockPermutation, BlockComponentBlockBreakEvent.brokenBlockPermutation, BlockComponentBlockStateChangeEvent.previousPermutation, BlockComponentEntityEvent.blockPermutation, BlockComponentOnPlaceEvent.previousBlock, BlockComponentPlayerBreakEvent.brokenBlockPermutation, BlockComponentPlayerPlaceBeforeEvent.permutationToPlace, EntityBreathableComponent.getBreatheBlocks, EntityBreathableComponent.getNonBreatheBlocks, EntityHitBlockAfterEvent.hitBlockPermutation, ItemComponentMineBlockEvent.minedBlockPermutation, ItemComponentUseOnEvent.usedOnBlockPermutation, LootTableManager.generateLootFromBlockPermutation, PlayerCancelBreakingBlockAfterEvent.blockPermutation, PlayerStartBreakingBlockAfterEvent.blockPermutation, BlockEventOptions.permutations, BlockFilter.excludePermutations, BlockFilter.includePermutations