Перейти к основному содержанию

Block.SpecialType

Special types are used to set properties to the block. Unlike items, blocks properties are defined using special types, due to old Inner Core's block IDs limitations.

Index

Properties

optionalbase

base?: number = 0

Vanilla block ID to inherit some of the properties.

optionalburn_odds
since: 3.1.0b125

burn_odds?: number = 0 // 20 for planks

Alternatively destroy by fire chance modifier, values between 0 and 100, with a higher number meaning more likely to be destroyed by fire.

optionalcan_be_extra_block
since: 2.2.1b95

can_be_extra_block?: boolean = false

Whether or not block may overlay different block, like water overlapping fillable blocks.

optionalcan_contain_liquid
since: 2.2.1b95

can_contain_liquid?: boolean = false

Whether or not block may filled by water bucket or other custom fillable liquids.

optionalcolor_source
since: 2.1.0b56

color_source?: ColorSource

Makes block use biome color source when displayed on the vanilla maps.

optionaldestroytime

destroytime?: number

Specifies the time required to destroy the block, in ticks.

optionalexplosionres

explosionres?: number = 3

Specifies how block resists to the explosions.

optionalflame_odds
since: 3.1.0b125

flame_odds?: number = 0 // 5 for planks

Alternatively catch on fire chance modifier, values between 0 and 100, with a higher number meaning more likely to catch on fire. For a "flame_odds" greater than 0, the fire will continue to burn until the block is destroyed (or it will burn forever if the "burn_odds" is 0).

optionalfriction

friction?: number = 0.6000000238418579

Specifies how player walks on this block. The higher the friction is, the more difficult it is to change speed and direction.

optionallightlevel

lightlevel?: number = 0

If non-zero value is used, the block emits light of that value. Default is no lighting, use values from 1 to 15 to set light level.

optionallightopacity

lightopacity?: number = 0

Specifies how opaque the block is. Default is transparent, use values from 1 to 15 to make the block opaque.

optionalmapcolor
since: 2.0.2b23

mapcolor?: number

Block color when displayed on the vanilla maps.

optionalmaterial

material?: number = 3

Block material constant to be inherited.

optionalname

name?: string

Unique string identifier of the SpecialType.

optionalrenderallfaces

renderallfaces?: boolean = false

If true, all block faces are rendered, otherwise back faces are not rendered, like for glass.

optionalrenderlayer

renderlayer?: number = 4

Specifies the layer that is used to render the block.

optionalrendertype

rendertype?: number = 0

Sets render type of the block. Default is full block, use other values to change block's shape.

optionalsolid

solid?: boolean = false

If true, the block is not transparent.

optionalsound
since: 2.0.2b25 (from 3.1.0b126 can be custom from resource packs)

sound?: Sound | (string & {})

Specifies sounds of the block, one of Block.Sound.

optionalstates
since: 2.4.0b122-4

states?: (string | number)[] = [“color”] // this state always has been here

Adds ability to apply states to this block, preferably using vanilla ones from EBlockStates, but if they are not enough, you can always add your own using BlockState.registerBlockState. Inexistent states are ignored.

optionaltranslucency

translucency?: number = 0

If non-zero value is used, the shadows will be rendered on the block. Default is zero, allows float values from 0 to 1.