For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockPistonComponent.md.

Class: BlockPistonComponent

block component

Beta

当存在时,此方块具有活塞般的行为。包含用于发现方块活塞状态的附加属性。

When present, this block has piston-like behavior. Contains additional properties for discovering block piston state.

Extends

Properties

block

readonly block: Block

Beta

Remarks

此组件所属的方块。

Block instance that this component pertains to.

Inherited from

BlockComponent.block


isMoving

readonly isMoving: boolean

Beta

Remarks

活塞是否正在伸出或缩回的过程中。

Whether the piston is in the process of expanding or retracting.

Throws

This property can throw when used.


isValid

readonly isValid: boolean

Beta

Remarks

返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。

Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component.

Inherited from

BlockComponent.isValid


state

readonly state: BlockPistonState

Beta

Remarks

活塞的当前状态。

The current state of the piston.

Throws

This property can throw when used.


typeId

readonly typeId: string

Beta

Remarks

组件的标识符。

Identifier of the component.

Inherited from

BlockComponent.typeId


componentId

readonly static componentId: "minecraft:piston" = 'minecraft:piston'

Beta

Methods

getAttachedBlocks()

getAttachedBlocks(): Block[]

Beta

Returns

Block[]

Remarks

检索此活塞连接的一组方块。

Retrieves a set of blocks that this piston is connected with.

Throws

This function can throw errors.


getAttachedBlocksLocations()

getAttachedBlocksLocations(): Vector3[]

Beta

Returns

Vector3[]

Remarks

检索此活塞连接的一组方块位置。

Retrieves a set of block locations that this piston is connected with.

Throws

This function can throw errors.

同领域相关