Class: BlockPistonComponent
block componentBeta
当存在时,此方块具有活塞般的行为。包含用于发现方块活塞状态的附加属性。
When present, this block has piston-like behavior. Contains additional properties for discovering block piston state.
Extends
Properties
block
readonlyblock:Block
Beta
Remarks
此组件所属的方块。
Block instance that this component pertains to.
Inherited from
isMoving
readonlyisMoving:boolean
Beta
Remarks
活塞是否正在伸出或缩回的过程中。
Whether the piston is in the process of expanding or retracting.
Throws
This property can throw when used.
isValid
readonlyisValid: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
state
readonlystate:BlockPistonState
Beta
Remarks
活塞的当前状态。
The current state of the piston.
Throws
This property can throw when used.
typeId
readonlytypeId:string
Beta
Remarks
组件的标识符。
Identifier of the component.
Inherited from
componentId
readonlystaticcomponentId:"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.
